# How to keep the X-Axis in node red

**URL:** <https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404>\
**Category:** Dashboard\
**Tags:** chart\
**Created:** [28 November 2022 21:57 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404 "2022-11-28T21:57:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 21:57 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/1 "2022-11-28T21:57:59Z")

</div>

I have this chart that is only showing the last value received and it is being replaced with every new value received and is not keeping any other values on the chart to trace them and show the history.

**The idea is to show the last 24 hours of data in the chart**

How can i accomplish this? Thank you

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfac5ddf01c4ff983a1eb5e3c418b2a14b04c392.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de3fba52b70c8a75b0319d0c71daa815cb1f4a12.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01f284989ae31844adcbfcae879db81498c80945.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [28 November 2022 22:00 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/2 "2022-11-28T22:00:47Z")

</div>

I think the problem is more in the `chart` node that the message you are sending it.

Can you export the `chart` node please?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [28 November 2022 22:08 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/4 "2022-11-28T22:08:33Z")

</div>

Nah, that didn't work.

As I am sure you can see.

You need to use the `</>` button.  
Please try again.  
Oh, also: In that `function` node: what is the purpose of the first line?

You could just EDIT the original post (above) rather than posting another try.

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 22:10 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/5 "2022-11-28T22:10:50Z")

</div>

```auto
[
    {
        "id": "b0422098a6b9a08d",
        "type": "webhookrelay",
        "z": "a1bcdc6a7a905fe6",
        "buckets": "",
        "x": 200,
        "y": 60,
        "wires": [
            [
                "ccdc1327defc8747"
            ]
        ]
    },
    {
        "id": "ccdc1327defc8747",
        "type": "json",
        "z": "a1bcdc6a7a905fe6",
        "name": "",
        "property": "payload",
        "action": "obj",
        "pretty": false,
        "x": 350,
        "y": 60,
        "wires": [
            [
                "0dce6426a3caa9bd"
            ]
        ]
    },
    {
        "id": "0dce6426a3caa9bd",
        "type": "change",
        "z": "a1bcdc6a7a905fe6",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.body",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 500,
        "y": 60,
        "wires": [
            [
                "5f0738a9f4ed9865"
            ]
        ],
        "info": "payload.body"
    },
    {
        "id": "5f0738a9f4ed9865",
        "type": "json",
        "z": "a1bcdc6a7a905fe6",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 670,
        "y": 60,
        "wires": [
            [
                "bda5bf77f04efd85"
            ]
        ]
    },
    {
        "id": "bda5bf77f04efd85",
        "type": "change",
        "z": "a1bcdc6a7a905fe6",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "fecha",
                "pt": "msg",
                "to": "payload.timestamp",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "temperatura",
                "pt": "msg",
                "to": "payload.measurements[2].data",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 820,
        "y": 60,
        "wires": [
            [
                "5234163e24f2a616"
            ]
        ],
        "info": "payload.body"
    },
    {
        "id": "5234163e24f2a616",
        "type": "function",
        "z": "a1bcdc6a7a905fe6",
        "name": "function 18",
        "func": "let fecha=new Date(msg.fecha);\nlet milisegundos=fecha.getTime();\n\nvar chart = [{\n \"series\": [\"A\"],\n \"data\": [[{ \"x\":milisegundos, \"y\":msg.temperatura}]],\n \"labels\": [\"\"]\n}];\nmsg.payload = chart;\n\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1050,
        "y": 60,
        "wires": [
            [
                "2ba287094a879405"
            ]
        ]
    },
    {
        "id": "2ba287094a879405",
        "type": "ui_chart",
        "z": "a1bcdc6a7a905fe6",
        "name": "",
        "group": "dad27409d00b75af",
        "order": 8,
        "width": 0,
        "height": 0,
        "label": "Prueba ",
        "chartType": "line",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "",
        "dot": true,
        "ymin": "10",
        "ymax": "30",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "86400",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 1440,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "dad27409d00b75af",
        "type": "ui_group",
        "name": "Pruebas",
        "tab": "f518b18327287f13",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "f518b18327287f13",
        "type": "ui_tab",
        "name": "Tab inicial",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

The first node is called "Webhook relay"

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 22:11 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/6 "2022-11-28T22:11:51Z")

</div>

i'll explain you about what i do

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 22:13 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/7 "2022-11-28T22:13:13Z")

</div>

That's a Weather Station, the weather station send the data via Webhook (For this i have that node) And that comes in JSON format

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [28 November 2022 22:19 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/8 "2022-11-28T22:19:09Z")

</div>

Ok, but....

I don't think it is helping you having TWO `JSON` nodes in the flow.  
(Which version of NR are you using?)  
The second `change` node: you are setting the `msg.fecha` to `msg.payload.timestamp`.  
Does that exist? (`msg.payload.timestamp`?)  
It doesn't seem to be **really** used.  
It is _used_ in the `function` node to set a variable's name, but that variable isn't used.

What happens if you ONLY send this:

(in the `function` node delete ALL the code and put ONLY THIS)

```auto
msg.payload = msg.temperatura;
return msg;

```

Just to indulge me.

Basically this is the flow.

```auto
[{"id":"47d34eb58e2b0e28","type":"function","z":"9b04fbf83e08a815","name":"function 19","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":500,"wires":[["6e251dd76978683d"]]},{"id":"0ea54ab2d7765f28","type":"json","z":"9b04fbf83e08a815","name":"","property":"payload","action":"obj","pretty":false,"x":760,"y":500,"wires":[["47d34eb58e2b0e28"]]},{"id":"6e251dd76978683d","type":"ui_chart","z":"9b04fbf83e08a815","name":"","group":"dad27409d00b75af","order":8,"width":0,"height":0,"label":"Prueba ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"10","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1090,"y":500,"wires":[[]]},{"id":"223d66608b5eeb04","type":"webhookrelay","z":"9b04fbf83e08a815","buckets":"","x":560,"y":500,"wires":[["0ea54ab2d7765f28"]]},{"id":"dad27409d00b75af","type":"ui_group","name":"Pruebas","tab":"f518b18327287f13","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f518b18327287f13","type":"ui_tab","name":"Tab inicial","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [28 November 2022 22:23 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/9 "2022-11-28T22:23:55Z")

</div>

(I have to go. Hope that last post helped you some how.)

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 22:35 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/10 "2022-11-28T22:35:14Z")

</div>

Thanks for the help but, That doesnt help me.

I need the every JSON nodes, i need every nodes that i sent you. Just have to fix that with the chart

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [28 November 2022 22:58 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/11 "2022-11-28T22:58:38Z")

</div>

For the chart either just connect the node that has the `msg.temperature` as an output to the ui\_chart node. This will automatically show that data and the time is current time formatted by the chart node.

OR

remove the `"data": [...]` from `var chart` and use

```auto
let chart = {
    "series": ["A"],
    "data": [[]],
    "labels": []
}

chart.data[0].push({x: milisegundos, y: msg.temperature})

msg.payload = chart

```

Should work but not tested

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 23:03 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/12 "2022-11-28T23:03:25Z")

</div>

Ohh thanks! i'm gonna try

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 23:08 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/13 "2022-11-28T23:08:07Z")

</div>

Negative! Didnt work

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

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [28 November 2022 23:08 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/14 "2022-11-28T23:08:57Z")

</div>

The debug is an array, Do you have idea how to work?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/183bcaf1349ef358f75adbdf75fed0074e78cdae.png)

---

<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:** [28 November 2022 23:14 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/15 "2022-11-28T23:14:11Z")

</div>

If this is live data you just need to feed the temperature reading in as msg.payload and msg.topic as the series/label.  
e.g.

```auto
[{"id":"b0422098a6b9a08d","type":"webhookrelay","z":"452103ea51141731","buckets":"","x":180,"y":3880,"wires":[["ccdc1327defc8747"]]},{"id":"ccdc1327defc8747","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":3880,"wires":[["0dce6426a3caa9bd"]]},{"id":"0dce6426a3caa9bd","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.body","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":3880,"wires":[["5f0738a9f4ed9865"]],"info":"payload.body"},{"id":"5f0738a9f4ed9865","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"","pretty":false,"x":650,"y":3880,"wires":[["bda5bf77f04efd85"]]},{"id":"bda5bf77f04efd85","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.measurements[2].data","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":3880,"wires":[["2ba287094a879405"]],"info":"payload.body"},{"id":"2ba287094a879405","type":"ui_chart","z":"452103ea51141731","name":"","group":"dad27409d00b75af","order":8,"width":0,"height":0,"label":"Prueba ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"10","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":980,"y":3940,"wires":[[]]},{"id":"dad27409d00b75af","type":"ui_group","name":"Pruebas","tab":"f518b18327287f13","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f518b18327287f13","type":"ui_tab","name":"Tab inicial","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [29 November 2022 00:06 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/16 "2022-11-29T00:06:22Z")

</div>

No work, I need the function because i need that timestamp value stay in X-Axis in the chart. Do you have idea?

---

<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:** [29 November 2022 00:22 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/17 "2022-11-29T00:22:46Z")

</div>

Great feed back "not work". Could you help by giving more info , what errors did you get, what did you see in chart.

As said all you need to do is feed the reading as msg.payload and give a topic for live data. You do not need a timestamp as chart will add one. Saying that you can send a timestamp in msg.timestamp also. All the info you need is here [node-red-dashboard/Charts.md at master · node-red/node-red-dashboard · GitHub](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md)  
here is example with a timestamp

```auto
[{"id":"bf38e6dc21a1b3e3","type":"webhookrelay","z":"452103ea51141731","buckets":"","x":200,"y":3760,"wires":[["b40d1ee1892062f0"]]},{"id":"b40d1ee1892062f0","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"obj","pretty":false,"x":350,"y":3760,"wires":[["edaada43ad3a90f3"]]},{"id":"edaada43ad3a90f3","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.body","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":3760,"wires":[["14467fdb64d10a49"]],"info":"payload.body"},{"id":"14467fdb64d10a49","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"","pretty":false,"x":670,"y":3760,"wires":[["52f7ce4d653fd16c"]]},{"id":"52f7ce4d653fd16c","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"payload.timestamp","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.measurements[2].data","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":3760,"wires":[["9a4c1d9ffd55e1fc"]],"info":"payload.body"},{"id":"9a4c1d9ffd55e1fc","type":"ui_chart","z":"452103ea51141731","name":"","group":"ab373fd2c5b09a8c","order":8,"width":0,"height":0,"label":"Prueba ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"10","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1000,"y":3820,"wires":[[]]},{"id":"ab373fd2c5b09a8c","type":"ui_group","name":"Pruebas","tab":"f518b18327287f13","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f518b18327287f13","type":"ui_tab","name":"Tab inicial","icon":"dashboard","disabled":false,"hidden":false}]

```

If you want more help please supply the errors you are seeing and the complete msg debug output of the webhook node. in a copyable format.

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [29 November 2022 02:10 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/18 "2022-11-29T02:10:36Z")

</div>

> [@E1cid](#):
>
> ```auto
> [{"id":"bf38e6dc21a1b3e3","type":"webhookrelay","z":"452103ea51141731","buckets":"","x":200,"y":3760,"wires":[["b40d1ee1892062f0"]]},{"id":"b40d1ee1892062f0","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"obj","pretty":false,"x":350,"y":3760,"wires":[["edaada43ad3a90f3"]]},{"id":"edaada43ad3a90f3","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.body","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":3760,"wires":[["14467fdb64d10a49"]],"info":"payload.body"},{"id":"14467fdb64d10a49","type":"json","z":"452103ea51141731","name":"","property":"payload","action":"","pretty":false,"x":670,"y":3760,"wires":[["52f7ce4d653fd16c"]]},{"id":"52f7ce4d653fd16c","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"payload.timestamp","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.measurements[2].data","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":3760,"wires":[["9a4c1d9ffd55e1fc"]],"info":"payload.body"},{"id":"9a4c1d9ffd55e1fc","type":"ui_chart","z":"452103ea51141731","name":"","group":"ab373fd2c5b09a8c","order":8,"width":0,"height":0,"label":"Prueba ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"10","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1000,"y":3820,"wires":[[]]},{"id":"ab373fd2c5b09a8c","type":"ui_group","name":"Pruebas","tab":"f518b18327287f13","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f518b18327287f13","type":"ui_tab","name":"Tab inicial","icon":"dashboard","disabled":false,"hidden":false}]
> 
> ```

oh yes, You are right, The webhook give me this code with the 2 JSONS:

```auto
object
deviceName: "Weather Station"
deviceSerialNumber: "CM.S2B.1.1.0-N0000117"
measurements: array[6]
0: object
latitude: 6.071770000000001
longitude: -75.33387
name: "location"
1: object
data: 3
name: "air-quality"
2: object
data: 15.740000000000002
name: "temperature"
3: object
data: 97.48
name: "humidity"
4: object
data: 240
data2: 0.625
name: "wind-speed"
5: object
data: 4045
name: "battery"
timestamp: "2022-11-28T18:00:01Z"

```

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [29 November 2022 02:15 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/19 "2022-11-29T02:15:25Z")

</div>

I´ll try your code, I need that the timestamp is set in the X-Axis in the chart, Because the true hour that i want to see is located in timestamp value.

---

<div class="post-metadata">

**Author:** ![itzjujo092](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/itzjujo092/32/76970_2.png) [@itzjujo092](https://discourse.nodered.org/u/itzjujo092)\
**Post date:** [29 November 2022 15:51 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/20 "2022-11-29T15:51:25Z")

</div>

Hey man, Thanks a lot!! That work very well.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6ca6a3b112f6d2c6f6340b7ce822448c76bb987.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:** [13 December 2022 15:52 UTC](https://discourse.nodered.org/t/how-to-keep-the-x-axis-in-node-red/71404/21 "2022-12-13T15:52:24Z")

</div>

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