# Display influxdb-2 data in dashboard-2

**URL:** <https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887>\
**Category:** Dashboard\
**Created:** [25 February 2024 15:56 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887 "2024-02-25T15:56:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [25 February 2024 15:56 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/1 "2024-02-25T15:56:57Z")

</div>

Hello everyone,

I have created a flow that is receiving fake temperature values (using random function) from an ESP32 using MQTT. I use influxdb v2 to store the values.

My problem is that I cannot display the last hour data in a dashboard chart, when pressing a button.

The flow that I'm using in order to display the data is

 ![flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13030c158b6ee145e8829dc2fd2dbe4a9a7b6431.png)

and the query is

```auto
from(bucket:"test1")
  |> range(start: -1h)
  |> filter(fn: (r) => r["_measurement"] == "test1" and r["_field"] == "temperature")

```

As you can see in the following image, the table shows the data but the chart doesn't.

 ![screenshot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9591e679f03f11a99cd958c9c533424fdaa49d4.png)

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![grant1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grant1/32/49890_2.png) [@grant1](https://discourse.nodered.org/u/grant1)\
**Post date:** [25 February 2024 16:25 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/2 "2024-02-25T16:25:01Z")

</div>

I cannot determine from your screenshot if the time axis is using 24h time or AM/PM, but are you sure that the time values in the table (14:31, etc.) are included in the timespan on the graph? In other words, can you expand the time window out and see _ **any** _ points?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2024 16:37 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/3 "2024-02-25T16:37:43Z")

</div>

Does the format of the data that you are sending to the chart match one of the valid alternatives for the chart node?

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [25 February 2024 16:46 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/4 "2024-02-25T16:46:43Z")

</div>

Thank you both for your time.

I'm using AM/PM in the time axis.

Here is the chart node

 ![chart](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/e/6ea9248cad6389f93d2cba6f73f3fe40db01152a.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:** [25 February 2024 16:49 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/5 "2024-02-25T16:49:02Z")

</div>

~~That looks like dashboard1 chart config, not dashboard2.~~ I think the node colour should be changed to stop confusion,

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [25 February 2024 16:55 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/6 "2024-02-25T16:55:16Z")

</div>

Hello @E1cid

Isn't that a dashboard-2 node?

 ![dashboard-2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8eebad0c856ff147273bd89c2231ebeaab912985.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:** [25 February 2024 16:59 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/7 "2024-02-25T16:59:32Z")

</div>

You're correct, see told you i find it confusing.

What is your data like , best show an example in text format.

You need to set the x and y property keys. Probably msg.\_time/msg.\_value

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [25 February 2024 17:14 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/8 "2024-02-25T17:14:37Z")

</div>

I'm sending the debug messages.  
Is it enough for you?

 ![debug](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/426a81d71bac0ba0ac41e2ef405cc5a41fa773e6.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:** [25 February 2024 17:28 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/9 "2024-02-25T17:28:08Z")

</div>

I did say in text format so we can copy the data, we do not need all the array just say 5 or 6 rows.

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

So use copy value and the edit the array down to 5 or 6 elements, then

In order to make code readable, usable and easy to copy it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2024 17:40 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/10 "2024-02-25T17:40:32Z")

</div>

> [@E1cid](#):
>
> So use copy path and the edit the array down to 5 or 6 elements, then

Should that be copy value?

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [25 February 2024 17:43 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/11 "2024-02-25T17:43:38Z")

</div>

I'm not sure that I fully understand...  
Sorry about that.

I have used a text node in order to take the values of the last minute.  
Is it correct?

```auto
[{ "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:36:43.772Z", "_value": 12, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:36:48.773Z", "_value": 1, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:36:53.774Z", "_value": 15, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:36:58.774Z", "_value": 16, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:03.778Z", "_value": 1, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:08.775Z", "_value": 15, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:13.778Z", "_value": 15, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:18.78Z", "_value": 19, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:23.78Z", "_value": 1, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:28.781Z", "_value": 9, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:33.784Z", "_value": 3, "_field": "temperature", "_measurement": "test1" }, { "result": "_result", "table": 0, "_start": "2024-02-25T17:36:42.18868378Z", "_stop": "2024-02-25T17:37:42.18868378Z", "_time": "2024-02-25T17:37:38.784Z", "_value": 7, "_field": "temperature", "_measurement": "test1" }]

```

---

<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:** [25 February 2024 18:04 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/12 "2024-02-25T18:04:14Z")

</div>

Seems the new dashboard2 chart only likes the x property in unix timestamp milliseconds  
e.g.

```auto
[{"id":"1e590caec784e108","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test","payload":"[{\"result\":\"_result\",\"table\":0,\"_start\":\"2024-02-25T17:36:42.18868378Z\",\"_stop\":\"2024-02-25T17:37:42.18868378Z\",\"_time\":\"2024-02-25T17:36:43.772Z\",\"_value\":12,\"_field\":\"temperature\",\"_measurement\":\"test1\"},{\"result\":\"_result\",\"table\":0,\"_start\":\"2024-02-25T17:36:42.18868378Z\",\"_stop\":\"2024-02-25T17:37:42.18868378Z\",\"_time\":\"2024-02-25T17:36:48.773Z\",\"_value\":1,\"_field\":\"temperature\",\"_measurement\":\"test1\"},{\"result\":\"_result\",\"table\":0,\"_start\":\"2024-02-25T17:36:42.18868378Z\",\"_stop\":\"2024-02-25T17:37:42.18868378Z\",\"_time\":\"2024-02-25T17:36:53.774Z\",\"_value\":15,\"_field\":\"temperature\",\"_measurement\":\"test1\"},{\"result\":\"_result\",\"table\":0,\"_start\":\"2024-02-25T17:36:42.18868378Z\",\"_stop\":\"2024-02-25T17:37:42.18868378Z\",\"_time\":\"2024-02-25T17:36:58.774Z\",\"_value\":16,\"_field\":\"temperature\",\"_measurement\":\"test1\"},{\"result\":\"_result\",\"table\":0,\"_start\":\"2024-02-25T17:36:42.18868378Z\",\"_stop\":\"2024-02-25T17:37:42.18868378Z\",\"_time\":\"2024-02-25T17:37:03.778Z\",\"_value\":1,\"_field\":\"temperature\",\"_measurement\":\"test1\"}]","payloadType":"json","x":150,"y":4860,"wires":[["001081e723930cef"]]},{"id":"001081e723930cef","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload ~> |$|{\"_time\":$toMillis($._time)}|","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":220,"y":4920,"wires":[["58069540b7e65fbf"]]},{"id":"58069540b7e65fbf","type":"ui-chart","z":"b779de97.b1b46","group":"fa6f27a81c4d2539","name":"","label":"chart","order":9007199254740991,"chartType":"line","category":"topic","categoryType":"msg","xAxisProperty":"_time","xAxisPropertyType":"msg","xAxisType":"linear","yAxisProperty":"_value","ymin":"","ymax":"","action":"replace","pointShape":"circle","pointRadius":4,"showLegend":true,"removeOlder":"1","removeOlderUnit":"86400","removeOlderPoints":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"width":6,"height":8,"className":"","x":310,"y":4860,"wires":[["a2714c8c86961aad"]]},{"id":"a2714c8c86961aad","type":"debug","z":"b779de97.b1b46","name":"debug 2482","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":4860,"wires":[]},{"id":"fa6f27a81c4d2539","type":"ui-group","name":"Tank Status","page":"b74745b3765efdef","width":"6","height":"1","order":-1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"b74745b3765efdef","type":"ui-page","name":"Tank Status Page","ui":"f2eea23e252f30f6","path":"/page2","icon":"home","layout":"grid","theme":"a965ccfef139317a","order":-1,"className":"","visible":"true","disabled":"false"},{"id":"f2eea23e252f30f6","type":"ui-base","name":"Dolores DB2","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

See my example inject with test data, that is all that is required to test not a 620 element array.

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [26 February 2024 10:31 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/13 "2024-02-26T10:31:38Z")

</div>

After many attempts, I couldn't find out the solution to my problem.  
So I used influxdb v1.8 and everything worked fine.  
I think that this version is more easy to handle.

Thank you for your time.  
Best regards.

---

<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:** [26 May 2024 10:32 UTC](https://discourse.nodered.org/t/display-influxdb-2-data-in-dashboard-2/85887/14 "2024-05-26T10:32:23Z")

</div>

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