cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How can I not upload all the data on time series chart?

kt1
3-Visitor
3-Visitor

How can I not upload all the data on time series chart?

I have a property called temperature, and all the data is saved in a value stream. Whenever I want to display this data in mashup I use 'time-series chart' . Now, this chart displayes all the 500 values from my data. how can I only display every 5th value like (5,10,15......) so that I know the pattern of temperature but not all the temperature on the graph.

9 REPLIES 9
PaiChung
22-Sapphire I
(To:kt1)

I've never done this but you could try using Interpolate which is part of InfoTable functions it is meant to give you a smooth graph which means that the values returned wouldn't be the actual values, but it would give you the ability to limit the number of points returned over a period of time.

Else you would have to get all the records you want in a wrapper service and then pull out every fifth.

posipova
20-Turquoise
(To:kt1)

You can create a custom service that queries every 5th value and then use that filtered data in your time series chart.

kt1
3-Visitor
3-Visitor
(To:posipova)

Hey Polina, can you explain in a little more detail how can I do that?

Thanks in advance!

posipova
20-Turquoise
(To:kt1)

Which service are you using right now to populate your Time series chart?

You'd have to write a code to filter all received values to display only each 5th. There are multiple ways to implement such a requirement. One of the solutions would be querying entries by the primary key incremented by 4 until the end of results. You may also fetch all data first and then go through it selecting only each 5th and putting it in the infotable. Regardless of how you decide to implement, the result/output would be an infotable type.

PaiChung
22-Sapphire I
(To:posipova)

Primary key may not work, because you could be having data for multiple sources in the same Stream, I believe the id of the stream is just a simple increasing number irregardless of source.

kt1
3-Visitor
3-Visitor
(To:PaiChung)

Hey, I get your point so this is what is happening, even if I write the code as the values keep on adding in value stream the number for those values will keep on changing.

PaiChung
22-Sapphire I
(To:kt1)

Right so instead of using the Key, you can get the records then based on the length determine how many you are going to grab and just grab them by using

var rowIWant = AllRows.rows(i) (I think it is parenthesis vs. square brackets)

kt1
3-Visitor
3-Visitor
(To:PaiChung)

I understand what you are saying but I am new with Thingworx can you explain me a little more in detail how to do it?

Thanks in advance.

kt1
3-Visitor
3-Visitor
(To:posipova)

Currently I am suring Query property History to display myy values

Top Tags