# eCharts as JavaScript external chart library

**URL:** <https://discourse.nodered.org/t/echarts-as-javascript-external-chart-library/4578>\
**Category:** Dashboard\
**Created:** [5 November 2018 12:03 UTC](https://discourse.nodered.org/t/echarts-as-javascript-external-chart-library/4578 "2018-11-05T12:03:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rcardos1](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rcardos1](https://discourse.nodered.org/u/rcardos1)\
**Post date:** [8 November 2018 02:07 UTC](https://discourse.nodered.org/t/echarts-as-javascript-external-chart-library/4578/3 "2018-11-08T02:07:38Z")

</div>

Thks Tottally for the tip... But yes I'm aware of the basic debugging techniques.

Just for the record... things are working OK now. The issue was that the 1st I tested sourcing the Java scripts from the webpage itself and the test page I had prepared was DLing quite a bit, (since I am on a Pi with Poor Wifi signal the connection is bad, sometimes I even loose the remote ssh connection... yes, I know... I should take care of it! 🙂 ) and I didn't wait long enough! (it took quite a few secs)...  
So I immidiately changed into sourcing the scripts locally, thinking something was wrong ☹ and the error was another one now... A simple '/' beggining slash was the issue. 😭

As a ref for others I'm posting below the basic flow test and just the snippet of template code. Don't forget to add echarts folder to a public folder/library of yours (after defining it in settings.js httpstatic part if you have not done so yet):

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

```
<script src="/echarts/build/dist/echarts-all.js"></script>
<div id="chart" style="width: 400px; height: 300px;"></div>
<script>
    var chart = document.getElementById('chart');
    var myChart = echarts.init(chart);
    var option = { ...here you set your graphs options... }
    myChart.setOption(option);
</script>

```

Thks for the help anyway!

---

_[View the full topic](https://discourse.nodered.org/t/echarts-as-javascript-external-chart-library/4578)._
