Can I use any data instead of time stamp in plotting widgets?


#1

Hi all
I wanna use another data series instead of time stamps where plotting. Is it possible?
Thank you


#2

Do you mean that you want a value vs value instead of a value vs time plot?

If so, using the timestamp at one of the values won’t work. Aside from the fact that you can only have one value per timestamp, all of the off-the-shelf plotting widgets will display values from recent history so unless your secondary value happens to be a unix timestamp from recent history you won’t see anything in the plots.

You could accomplish this with a custom widget. Unfortunately we don’t have any examples of plotting data in an X-Y plot, but check out the timeseries style example here: https://github.com/exosite-garage/custom_widget_scripts/tree/master/line_graphs/line_graph_using_flot as well as some of the examples from the Flot library (what that custom widget uses for plotting) here: http://www.flotcharts.org/flot/examples/


#3

Hi @Patrick
Firstly, thank you very much your instant answer. I mean, I want to plotting for example humidity vs temp. I dont want using time stamps as x or y axis.


#4

The off the shelf line graphs wouldn’t do this for you but you could create your own custom widget. Here are some example custom widget line graphs using the Flot javascript library. You can modify to take two dataports (temp and humidity), read a number of points for each, and then plot againest each other. You could also have one dataport that had was a formatted string (example json string: {“temp”:24.2,“humidity”:99} ) and then read that one dataport in the widget and parse the values out in javascript before graphing.


#5

Thank you @MikeA there is a good example for me.
I will share my results.