MySQL to dashboard chart - change function

connect a change node to the output of the mysql node.
in the change node select the j: expression option (the j: is for jsonata)
click the three dots on the right of the tab and it will open up.
paste in the code from Steve's example

[{
    "series": ["kW"],
    "labels": ["kW Used Today"],
    "data": [[payload.{
        "x": captureTime,
        "y": $."kW Used Today"
    }]]
}]

and in your case change captureTime to time and kW Used Today to value and change the series and labels test to what you want.

Then give it a go.

3 Likes