Query Historian to Fill Sparkline Array

I have a sparkline that's going to be overlaid on a tank to show 4 hours of level history. The tank level is stored in the historian. What's the best way to fill the array with the last 4 hours of data?

I've done a manual implementation of history using SQL and in that case I would've run a query and created a list from the results, but I'm not quite sure how to go about that from the built-in historian.

Also, since the tag is logged on-change and changes rather slowly, would it be beneficial to try and trim say, every other data point out of the list, or would that extra data not really slow any thing down? Or, maybe just change the historization settings to log less often?

Hello,

See screenshots. I have used this method and it works great.

image

You can adjust the amount of data to display in the first screenshot.

Regards,

Frank

Thanks for the tip. I had to look at the manual so see exactly what you were doing here.

https://docs.inductiveautomation.com/display/DOC81/Tag+History+Bindings+in+Perspective

I took it one step further and used a transform to change the dataset to be a list