I've tried to display multiple values with timestamps from the past in a chart.
I used the JSON-Format
[{"series": [" "], "data": [[{ "x": timestamp, "y": value }]],"labels": [""]}]
(timestamp/value-pairs received via MQTT; put in the right format in a function node).
The problem is that the chart only shows the last timestamp/value instead of the last 60 seconds. So I tried to use an array that holds the last 60 values (because I receive them every second), but it still shows only one value.
Your timestamps are strings not numbers convert them to integers with possibly parseInt(). Also you may want to convert your y values to floats with parseFloat().
I never thought about parsing, but it's working now with an array.
The values are displayed correctly, but the time is wrong. I set it to automatic, but it only moves in milliseconds and not in secoend, even though the timestamp does. It also looks like the timestamp is from 1970? I checked the source of the timestamp and it shows the correct time. So to me there is no indicator why it happens.
@Catelyna Your timestamps when parsed to integers are unix in seconds. You would need to convert to a js timestamp in milliseconds, by multiplying by 1000.