Chart node doesn't support epoch timestamps anymore?

Epoch timestamps worked until recently, but has the support really been removed in v1.20.0 of Dashboard-2? It's still a widely used format in time-series databases. Is ISO 8601 the only supported format now?

That definitely isn't intended, what are you seeing in terms of change of behaviour?

No line charts are visible, even if the legends indicate there are data series sent to the node, and the X- and Y-ranges are incorrect as well.

Example flow comparing ISO 8601 timestamps and epoch timestamps:

[{"id":"6b5d5a53d40b1af9","type":"inject","z":"48d14fe7d791d595","name":"Datetime strings","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"timestamp\":\"2024-12-06T12:30:15\",\"dp\":\"dp1\",\"val\":22},{\"timestamp\":\"2024-12-07T16:40:22\",\"dp\":\"dp1\",\"val\":27},{\"timestamp\":\"2024-12-08T13:16:42\",\"dp\":\"dp1\",\"val\":25}]","payloadType":"json","x":320,"y":240,"wires":[["5dcad4539a9e8864"]]},{"id":"5dcad4539a9e8864","type":"ui-chart","z":"48d14fe7d791d595","group":"b429518aee48a6fb","name":"","label":"chart","order":1,"chartType":"line","category":"dp","categoryType":"property","xAxisLabel":"","xAxisProperty":"timestamp","xAxisPropertyType":"property","xAxisType":"time","xAxisFormat":"yyyy-M-d HH:mm","xAxisFormatType":"custom","xmin":"","xmax":"","yAxisLabel":"","yAxisProperty":"val","yAxisPropertyType":"property","ymin":"","ymax":"","bins":10,"action":"replace","stackSeries":false,"pointShape":"circle","pointRadius":4,"showLegend":true,"removeOlder":1,"removeOlderUnit":"3600","removeOlderPoints":"","colors":["#0095ff","#ff0000","#ff7f0e","#2ca02c","#a347e1","#d62728","#ff9896","#9467bd","#c5b0d5"],"textColor":["#666666"],"textColorDefault":true,"gridColor":["#e5e5e5"],"gridColorDefault":true,"width":6,"height":8,"className":"","interpolation":"linear","x":530,"y":280,"wires":[[]]},{"id":"6aa5980609418728","type":"inject","z":"48d14fe7d791d595","name":"Datetime epoch","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"timestamp\":1733484615000,\"dp\":\"dp1\",\"val\":22},{\"timestamp\":1733586022000,\"dp\":\"dp1\",\"val\":27},{\"timestamp\":1733660202000,\"dp\":\"dp1\",\"val\":25}]","payloadType":"json","x":320,"y":320,"wires":[["5dcad4539a9e8864"]]},{"id":"b429518aee48a6fb","type":"ui-group","name":"Chart Examples","page":"d0621b8f20aee671","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"d0621b8f20aee671","type":"ui-page","name":"Charts","ui":"b7fd8a2cce8052cc","path":"/charts","icon":"home","layout":"notebook","theme":"5075a7d8e4947586","order":1,"className":"","visible":"true","disabled":"false"},{"id":"b7fd8a2cce8052cc","type":"ui-base","name":"ui7","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-dropdown","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"default","titleBarStyle":"default","notificationDisplayTime":5},{"id":"5075a7d8e4947586","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

I did some more testing, and it seems that the X-Axis Limit caused problems. I thought this parameter was only meant for live data, and not data from a time series database. It only caused problems for epoch timestamps, so I assume this isn't the intended behaviour of clearing stale data. Setting the limit to "Last 100 Weeks" seemed to fix the problem.

1 Like

Yep, thanks for digging into this. I'll be chsnging the default on this to be a much larger number as thats not intuitive to change

Joe, while you are doing that I noticed another little anomaly with the Chart node. I doubt it has / will cause any agro, but data can be appended to a bar chart (at least according to the dropdown) and there is nowhere to set a limit.
I suspect allowing the option was an oversight as I am not sure why data would need to be added to a bar chart.

I can think of some scenarios where you might want to append data to a bar chart... such as a live pass/fail chart that is being updated in realtime from a process.

I had mentioned the issue with the "Timescale" charts no longer working in v1.20.0 through the FlowFuse chat the other day... I'm glad someone was able to get to the bottom of it and offer an intermediate work around with the "Last 100 Weeks" setting.

1 Like