Hi all,
I am trying to put 2x lines on one chart from mysql data. I could create msg.payload as below but only legends show up, no lines... anything I missed or did wrong? Appreciate your advice.
Thank you, Steve. that's good to know. i tried the multiple lines example on your link and its works. And the document says about a single piece of data to plot multiple lines as below, but I struggled to understand. is there any example?
If you want a single piece of data to plot multiple lines, you can set the Series property to JSON, and then provide an array of keys (e.g. ["key1", "key2"]), which will plot a data point for each key provided, from a single data point.
Found an example exact I was looking for at very end of this article...
And with this, can draw a chart without any data conversion of mysql output... Now agree to Steve's comment. Drawing speed was improved too. And it may not good practice put large data set for darwing chart.
Thanks for posting that flowfuse blog post, I had hot seen that.
The main difference between that and my example linked above seems to be that mine plots the same property, temperature, as a different line for each sensor while Joe plots temperature and humidity for a single sensor as two lines on the chart.
Depends on your data structure and what you are plotting.
You can't really display a chart with 5000 points on a monitor maybe 1900 pixels wide.
If the data comes from an SQL database you can use the query to reduce it eg select timestamp, temperature from mydata where id % 5 = 0
Or perhaps split, filter and join nodes to only include significantly different points.