# Chart.js node - cannot GET TP01

**URL:** <https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457>\
**Category:** General\
**Created:** [18 August 2019 18:05 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457 "2019-08-18T18:05:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdwardDM10](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@EdwardDM10](https://discourse.nodered.org/u/EdwardDM10)\
**Post date:** [18 August 2019 18:05 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/1 "2019-08-18T18:05:26Z")

</div>

Again, total newbie so pointers would be most welcome.

I've downloaded this -

> **[node-red-contrib-chartjs](https://flows.nodered.org/node/node-red-contrib-chartjs)**
>
> Node-RED Chart.js node

...but am struggling to get it to work.

I've set up the flow as per the example on the page (I think) and put it on a 30 second trigger.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1c1f4e9f9f39b2f47d5241f83f0712a8489f714b.png)

I then navigate to localhost:1880/TP01 and get

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2f2ce1bffdef19c92c5ab0d0edc1f97500c6bc2d.png)

Am I approaching this the wrong way? The page says there should be some examples (I assume under Import --\> Examples) but I can't find them.

---

<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:** [18 August 2019 18:20 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/2 "2019-08-18T18:20:30Z")

</div>

I believe the `TP01` is the value in channel so you should be using `localhost:1880/Population`

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [18 August 2019 18:23 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/3 "2019-08-18T18:23:43Z")

</div>

> [@zenofmud](#):
>
> I believe the `TP01` is the value in channel

No, following the docs channel is how the data shows up in the legend. The path is set through the configuration of the node, with the path parameter.

@EdwardDM10 can you post your flow so we can see how you have configured this chart node? The value for `path` is the endpoint that you access in the browser. While the sample screenshots use “TP01”, you might have set this to something else.

The included example is located here: [node-red-contrib-chartjs/example/dashboard.json at master · masalinas/node-red-contrib-chartjs · GitHub](https://github.com/masalinas/node-red-contrib-chartjs/blob/master/example/dashboard.json)  
As you can see it uses both the channel (for setting the legend) as well as the path to TP01.

On the other hand, this node has several open issues, one with a pull request that doesn’t have replies nor is merged. That issue mentions a deploy breaks the CSS and JS files needed to display the chart due to a change/fix Node-RED did. [deploy breaks all supporting \*.js and \*.css files · Issue #15 · masalinas/node-red-contrib-chartjs · GitHub](https://github.com/masalinas/node-red-contrib-chartjs/issues/15)  
So this might not be the best node to use in combination with NR 0.20.7

---

<div class="post-metadata">

**Author:** ![EdwardDM10](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@EdwardDM10](https://discourse.nodered.org/u/EdwardDM10)\
**Post date:** [18 August 2019 18:40 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/4 "2019-08-18T18:40:24Z")

</div>

```auto
[{"id":"98da9cdb.eeb67","type":"inject","z":"86ca3569.b8cc98","name":"30Seconds","topic":"","payload":"{ \"channel\": \"Population\", \"color\": \"Green\", \"dataset\": [{ \"x\": \"Europe\", \"y\": 741 }, { \"x\": \"Australia\", \"y\": 24 }, { \"x\": \"Africa\", \"y\": 1.2 }, { \"x\": \"America\", \"y\": 325 }, { \"x\": \"Asia\", \"y\": 4.4 }] }","payloadType":"json","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":506,"y":770,"wires":[["35635b96.038f74"]]},{"id":"35635b96.038f74","type":"chartjs-line","z":"86ca3569.b8cc98","name":"","path":"http://localhost:1880/TP01","charttitle":"A Title","xaxis":"X-Axis","yaxis":"Y-Axis","x":713.5,"y":731,"wires":[["6423fc7.1e6ae04"]]},{"id":"6423fc7.1e6ae04","type":"debug","z":"86ca3569.b8cc98","name":"DebugChartJS","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":957,"y":713,"wires":[]}]

```

Edited a few times

---

<div class="post-metadata">

**Author:** ![EdwardDM10](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@EdwardDM10](https://discourse.nodered.org/u/EdwardDM10)\
**Post date:** [18 August 2019 18:46 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/5 "2019-08-18T18:46:33Z")

</div>

Ah, from comparing the example to what I have the issue seems to be the "path". I am using the whole '[http://localhost:1880/TP01](http://localhost:1880/TP01)' where as the examples just use 'TP01'.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6c6ddc3a3b8c5d9d7dd5addeee30a77f729c37c7.png)

That being said, I note what you say about the pull requests....

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 August 2019 19:55 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/6 "2019-08-18T19:55:17Z")

</div>

Without wishing to blow my own trumpet. If you get totally stuck with this, I've just posted a number of charting examples for uibuilder. You would have to write some code but the examples already have most of it in place.

The advantage is that you have examples to work off, you can create any kind of interface you like including having multiple charts on one page or splitting them into multiple pages if you like. And you can configure the charts just how you want them.

---

<div class="post-metadata">

**Author:** ![EdwardDM10](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@EdwardDM10](https://discourse.nodered.org/u/EdwardDM10)\
**Post date:** [18 August 2019 20:27 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/7 "2019-08-18T20:27:13Z")

</div>

Nothing wrong with a bit of trumpet blowing!

I am extremely new to anything JS related (I mostly do PLCs). I will certainly have a look through.

---

<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:** [18 August 2019 20:51 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/8 "2019-08-18T20:51:30Z")

</div>

Presumably you have already rejected the standard dashboard chart as not meeting your requirements.

---

<div class="post-metadata">

**Author:** ![EdwardDM10](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@EdwardDM10](https://discourse.nodered.org/u/EdwardDM10)\
**Post date:** [19 August 2019 09:34 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/9 "2019-08-19T09:34:16Z")

</div>

Hi @Colin there is no real requirement yet. I am just dipping my toes in the water, as it were, to see what is possible.

I'd really like something that lets me drag a box around some data points to zoom in, and something that lets me export the chart and associated data points without being too complicated to set up (that is what prodded me towards Charts.js)

I've been playing with the standard chart, sliders to feed ymin and ymax etc, and it seems fine. I guess data export can be handled through another node.

---

<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:** [19 August 2019 09:41 UTC](https://discourse.nodered.org/t/chart-js-node-cannot-get-tp01/14457/10 "2019-08-19T09:41:02Z")

</div>

Many who want more sophisticated charts use node-red to send the data to influxdb and use Grafana for the charts. With those you can look back at historical data, zoom in and out, etc.
