FlowFuse / node-red-dashboard

https://dashboard.flowfuse.com
Apache License 2.0
156 stars 35 forks source link

Investigate Apache ECharts as a ChartJs alternative for ui-chart #782

Open joepavitt opened 2 months ago

joepavitt commented 2 months ago

Description

Apache ECharts offer a far vaster collection of charts, with a very similar API, and extensive examples in their documentation.

Whilst @Steve-Mcl mentioned this a while ago, we had no obvious reason to be investing the time in switching these over, however, with https://github.com/FlowFuse/node-red-dashboard/issues/676 being raised and investigated, I feel we now have no other option but to investigate Apache eCharts as an alternative charting library as the performance of ChartsJS, with regularly updating charts is not viable.

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

### Tasks
- [ ] Investigate the workload required to switch from ChartJS to ECharts
nileio commented 2 months ago

most of my charts are apache echarts - my suggestion is to have a less priority to this feature because echarts is a real beast with every possible option and chart type best implemented in ui-template in my opinion .. it is however the best out there

joepavitt commented 2 months ago

my suggestion is to have a less priority to this feature because echarts is a real beast with every possible option

We wouldn't be exposing every option in the ui-chart node, we don't know vs. what ChartJS actually offers. We do though, need a more reliable charting solution that can handle the quanities (and frequency) of data our dashboards are providing.

nileio commented 2 months ago

hands down, I vouch for Apache eCharts as in my own implementation I actually hardly ever used Node-RED own charts widgets and depend on eCharts for everything- however, i do have to construct echarts so-called option which can be quite complex and so what I meant to say is exposing echarts option as attributes for each chart type widget in Node-RED would be rather a complex and long exercise - I think alternatively we could work on a dedicated widget for echarts which simply takes in a JSON object for its option and let the user construct it anyway they like - this would be easier to implement and would provide flexibility.. however this depends on whether it is decided to include echarts as an integral part of the project or leave it to community contributions.. just a side note echarts handles data updates internally (as in does not have dedicated data update APIs) and so it compares the input data to its current data to determine if there are updates - it still works pretty good in large datasets - I use it for candlestick data with millions of data points