# Iot\_datasource is not showing the graph

**URL:** <https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716>\
**Category:** Dashboard\
**Created:** [20 July 2018 16:13 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716 "2018-07-20T16:13:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alice\_Coutinho](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Alice\_Coutinho](https://discourse.nodered.org/u/Alice_Coutinho)\
**Post date:** [20 July 2018 16:13 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/1 "2018-07-20T16:13:02Z")

</div>

I have historical data stored in a SQL Database as Datum in the format (2017.10.27 12:00:25) and the corresponding Temp in the format (26.55). I am using the node iot\_datasourse to show the data and the debug message shows the time and the corresponding temperature, but the dashboard doesn't show any graphic. The flow nodes are as follows, I would appreciate some help

[{"id":"280b51a9.1d20ee","type":"iot-datasource","z":"a287c70.b313638","name":"Temperature\_historical\_data","tstampField":"tstamp","dataField":"data","disableDiscover":false,"x":800,"y":420,"wires":[["d2f6ac7.9847f5"]]},{"id":"174ee565.e02b2b","type":"function","z":"a287c70.b313638","name":"Temp","func":"var p =msg.payload;\n\nfor(var i=0;i\<p.length;i++){\n var dUnix =Date.parse(p[i].Datum);\n node.send({payload:{data:p[i].Temp, tstamp:dUnix}});\n}\nreturn;","outputs":1,"noerr":0,"x":590,"y":420,"wires":[["280b51a9.1d20ee","5f0d558f.04310c"]]},{"id":"a74a3ded.a929e","type":"MSSQL","z":"a287c70.b313638","mssqlCN":"e1823c68.173aa","name":"database\_sql","query":"","outField":"payload","x":430,"y":420,"wires":[["174ee565.e02b2b"]]},{"id":"542c5d2d.ed21e4","type":"inject","z":"a287c70.b313638","name":"","topic":"","payload":"SELECT \* FROM [test].[Temp]","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":420,"wires":[["a74a3ded.a929e"]]},{"id":"5f0d558f.04310c","type":"debug","z":"a287c70.b313638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":340,"wires":[]},{"id":"d2f6ac7.9847f5","type":"debug","z":"a287c70.b313638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":340,"wires":[]},{"id":"e1823c68.173aa","type":"MSSQL-CN","z":"","name":"SQL","server":"localhost","encyption":true,"database":"test"}]

---

<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:** [21 July 2018 07:16 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/2 "2018-07-21T07:16:15Z")

</div>

I can't find any reference to an iot\_datasource node ([flows.nodered.org](http://flows.nodered.org) appears to be down which doesn't help). Can you provide a link to the node on npm?

Is that node supposed to show something on the dashboard? If not then I don't see a dashboard node in the flow.

---

<div class="post-metadata">

**Author:** ![Alice\_Coutinho](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Alice\_Coutinho](https://discourse.nodered.org/u/Alice_Coutinho)\
**Post date:** [21 July 2018 23:33 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/3 "2018-07-21T23:33:13Z")

</div>

It's this node: node-red-contrib-graphs

> **[node-red-contrib-graphs](https://flows.nodered.org/node/node-red-contrib-graphs)**
>
> A Node-RED graphing package. Contains a datasource node which handles historical data and live data streams, and a hackable visualization application designed to connect to the datasource nodes.

This node creates a different dashboard window and when we click "create new chart" it creates the charts we configured, but in my case it doesn't show the graphic, as shown in the photo...

 ![20180722_012407](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d68db60ab254091a5cdcfd251b1aa5f9d1ded009.jpg)

---

<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:** [22 July 2018 08:57 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/4 "2018-07-22T08:57:38Z")

</div>

I haven't used that node, but have you tried it using one of the example flows given?

---

<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:** [22 July 2018 10:16 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/5 "2018-07-22T10:16:44Z")

</div>

also, seeing how that node hasn't been updated in over two years, are you also using the node-red-node-dashboard? If so there may be a conflict.

---

<div class="post-metadata">

**Author:** ![Alice\_Coutinho](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Alice\_Coutinho](https://discourse.nodered.org/u/Alice_Coutinho)\
**Post date:** [22 July 2018 19:35 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/6 "2018-07-22T19:35:45Z")

</div>

I tried the examples and the graphics appear with no problems. I am only using the dashboard of the datasource node. I think my problem is in the function in the conversion of the date (2017.10.27 12:00:25) into a number because I changed the function like follows below and now I have this weird graphic and the point in blue is the first value of my temperature and the respective date. If you have any suggestions other than "Date.parse()" to convert the date to a number I would appreciate.

 ![20180722_213321](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0a1c52b98ff07625cc2a491575003f9ae6281d93.jpg)

[{"id":"280b51a9.1d20ee","type":"iot-datasource","z":"a287c70.b313638","name":"Temperature\_historical\_data","tstampField":"tstamp","dataField":"data","disableDiscover":false,"x":800,"y":420,"wires":[["d2f6ac7.9847f5"]]},{"id":"174ee565.e02b2b","type":"function","z":"a287c70.b313638","name":"Temp","func":"var p =msg.payload;\n\nfor(var i=0;i\<p.length;i++){\n node.send({payload:{data:p[i].Temp, tstamp:p[i].Datum}});\n}\nreturn;","outputs":1,"noerr":0,"x":590,"y":420,"wires":[["280b51a9.1d20ee","5f0d558f.04310c"]]},{"id":"a74a3ded.a929e","type":"MSSQL","z":"a287c70.b313638","mssqlCN":"e1823c68.173aa","name":"database\_sql","query":"","outField":"payload","x":430,"y":420,"wires":[["174ee565.e02b2b"]]},{"id":"542c5d2d.ed21e4","type":"inject","z":"a287c70.b313638","name":"","topic":"","payload":"SELECT \* FROM [test].[Temp]","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":420,"wires":[["a74a3ded.a929e"]]},{"id":"5f0d558f.04310c","type":"debug","z":"a287c70.b313638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":340,"wires":},{"id":"d2f6ac7.9847f5","type":"debug","z":"a287c70.b313638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":340,"wires":},{"id":"e1823c68.173aa","type":"MSSQL-CN","z":"","name":"SQL","server":"localhost","encyption":true,"database":"test"}]

---

<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:** [22 July 2018 21:19 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/7 "2018-07-22T21:19:51Z")

</div>

Feed a data point from the example into a debug node and show us what it looks like, then feed your data in and show us what that looks like. In fact first compare them and see if you can see the problem. You mention the date but you have not explained what it should be and what you have. Remember possibly no-one here has used that node.

---

<div class="post-metadata">

**Author:** ![Alice\_Coutinho](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Alice\_Coutinho](https://discourse.nodered.org/u/Alice_Coutinho)\
**Post date:** [23 July 2018 06:27 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/8 "2018-07-23T06:27:24Z")

</div>

The timestamp of the ramdom numbers is with the Time in this format

![20180723_082626](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/be2a585db1b46b2363120e7c6b0839009af82f01.jpg)

---

<div class="post-metadata">

**Author:** ![Alice\_Coutinho](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Alice\_Coutinho](https://discourse.nodered.org/u/Alice_Coutinho)\
**Post date:** [23 July 2018 06:39 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/9 "2018-07-23T06:39:44Z")

</div>

My timestamp is in the same format as the example, but still no graph.

 ![15323315986581823526177](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/64e09465d4910b934bd100e6fa5399aec911ee2c.jpg)

---

<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:** [23 July 2018 08:12 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/10 "2018-07-23T08:12:43Z")

</div>

Looks ok to me. Out of ideas, sorry.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [23 July 2018 14:57 UTC](https://discourse.nodered.org/t/iot-datasource-is-not-showing-the-graph/1716/11 "2018-07-23T14:57:53Z")

</div>

If you open the browser's dev console (F12), are there any javascript errors on the graph page? Also, can you post the node-red console log output that is shown when node-red starts up? That will clearly show us what versions of code are being used...
