Chartjs-React-chartjs-2 Line Chart not updating with State

0👍

So i solve this issue by passing "ref" prop of line chart in a local Variable link this

<Line ref={ref => this.chartRefernece = ref} width={500} height={150} data={options} legend={legend} className="network-chart" options={axisOptions} />

and to update simple called this.chartRefernece.chartInstance.update(); to update chart 🙂

Leave a comment