1 of 1 people found this helpful
Here's a link to the online help:
The section on intervals states:
The number of intervals to plot over. Typically, this would be the number of horizontal pixels in the trend. The default is '24'. For each interval, the data available is examined and significant values are returned. Each interval can produce up to 5 values if they are unique, the first value in the interval, the last value, the highest value, the lowest value and at most one exceptional point (bad status or digital state).
What if there are more than 300 points when you only asked for 300? Each X-axis plot pixel has a timestamp associated with it. If a value is found exactly at that pixel's timestamp, it will be returned. If a value is not found, then it will be interpolated using the next value before and after that timestamp. The whole reason to use Plot is because it will be faster and more efficient. It makes little sense to retrieve 300,000 values when your plot only has 300 pixels. So instead Plot will only grab the 300 pixels.
As for your hunch that you are getting interpolated data, which does look at the value before and after a timestamp. For a time range, the Start and End time would be 2 such timestamps.
Your question of how to get no values when receiving interpolated data can't be done. It's like asking for an odd number divisible by 2. Because you want interpolated data for a time range, you will at least have a value returned for the time range Start and End times. Those values might be recorded value or interpolated because that's what you asked for by virtue of using a Plot stream. If you want to receive only recorded value, that would required a Recorded value stream using a BoundaryType of Inside. However, if there are 300,000 values in the time range, you will get all 300,000 returned which may be a waste if your plot has 300 pixels on its X-axis.
Follow up question. Is there perhaps a quick way to determine whether or not there's recorded data in a given time range. Perhaps a Web API query that returns a boolean rather than all 300,000 values?
You could try an event-weighted Summary Count. If you pass a small time range, it should perform quickly enough. If you pass 5 years, it may take awhile.
Example using Sinusoid: