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

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

kt1
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

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

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.

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

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

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

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

Thanks in advance!

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

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.

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

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.

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

Currently I am suring Query property History to display myy values

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

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.

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

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)

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

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.