Stored Data into Array for Line Chart

#1

Hello all,

First post noobie here. I am looking for a method to take a string of values from a stored data file in the format:

{"timestamp":"2018-07-31T18:38:44.613Z","timeinstate":0}
{"timestamp":"2018-07-31T18:38:45.435Z","timeinstate":0}
{"timestamp":"2018-07-31T18:38:46.146Z","timeinstate":0}
{"timestamp":"2018-07-31T18:38:47.069Z","timeinstate":0}
{"timestamp":"2018-07-31T18:38:47.430Z","timeinstate":5}
{"timestamp":"2018-07-31T18:38:47.563Z","timeinstate":5}

And pass this as an array into a line chart to plot my historical saved data. I know this is a dashboard help but the method to get it to an array isn't necessarily a dashboard function. There is not a very good tutorial on this and I have been struggling with it for the past 2 days. Any help would be appreciated (these data points were made up for this example, it could be something like temperature, humidity etc...)

0 Likes

#2

Maybe you can find something helpful from this thread https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822

0 Likes

#3

Thank you, I got it to work. Instead of storing as JSON I stored at a single line separated by a dash and then just split the messages one at a time using that delimiter and sent to the chart.

0 Likes