# MySQL to dashboard chart - change function

**URL:** <https://discourse.nodered.org/t/mysql-to-dashboard-chart-change-function/14418>\
**Category:** Dashboard\
**Created:** [17 August 2019 12:16 UTC](https://discourse.nodered.org/t/mysql-to-dashboard-chart-change-function/14418 "2019-08-17T12:16:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 August 2019 13:17 UTC](https://discourse.nodered.org/t/mysql-to-dashboard-chart-change-function/14418/2 "2019-08-17T13:17:02Z")

</div>

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

```auto
[{
    "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.

---

_[View the full topic](https://discourse.nodered.org/t/mysql-to-dashboard-chart-change-function/14418)._
