# Creating a chart with custom X-axis values in Node-RED Dashboard using the "chart" node.

**URL:** https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666
**Category:** Dashboard
**Tags:** node-red-dashboard
**Created:** [9 July 2023 14:15 UTC](https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666 "2023-07-09T14:15:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Asiayqyyq](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Asiayqyyq](https://discourse.nodered.org/u/Asiayqyyq)
#### Post date: [9 July 2023 14:15 UTC](https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666/1 "2023-07-09T14:15:40Z")

</div>

Hello,  
I have a problem creating a chart in Node-RED's Dashboard using the "chart" node. I would like to display values on the X-axis other than just the system time. Currently, when using the "chart" node, the chart only shows measurements based on the system time. Is there any way to add other values to the X-axis, such as those retrieved from a JSON object?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [9 July 2023 14:40 UTC](https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666/2 "2023-07-09T14:40:44Z")

</div>

For a single line, non time series line chart, the payload should be

```auto
[{
    "series": ["X"],
    "data": [[5,6,9,10] ],
    "labels": ["Jan", "Feb", "Mar", "Apr"]
}]

```

Where labels is the x data values

More info from [link in help text](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md)

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [10 July 2023 09:25 UTC](https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666/3 "2023-07-10T09:25:33Z")

</div>

here is another example

```auto
[{"id":"d712fdf32a0a4925","type":"ui_button","z":"a0eee751005e0e89","name":"","group":"8c63781ab95a5a94","order":1,"width":"3","height":"1","passthru":false,"label":"Load Data","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"[{\"series\":[\"X\",\"Y\"],\"data\":[[5,6,9,10],[3,8,5,11]],\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\"]}]","payloadType":"json","topic":"topic","topicType":"msg","x":1880,"y":2340,"wires":[["38aef9b45e99c257"]]},{"id":"38aef9b45e99c257","type":"ui_chart","z":"a0eee751005e0e89","name":"Bar Chart","group":"8c63781ab95a5a94","order":2,"width":"20","height":"9","label":"{{mname}}","chartType":"bar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":2220,"y":2340,"wires":[[]]},{"id":"8c63781ab95a5a94","type":"ui_group","name":"Group 2","tab":"4f903fa3c7ed98d8","order":2,"disp":true,"width":"20","collapse":false,"className":""},{"id":"4f903fa3c7ed98d8","type":"ui_tab","name":"Dashboard2","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98b575e9325f8117609fee063cb83c29a96b4fec.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 August 2023 09:25 UTC](https://discourse.nodered.org/t/creating-a-chart-with-custom-x-axis-values-in-node-red-dashboard-using-the-chart-node/79666/4 "2023-08-09T09:25:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
