valor-software / ng2-charts

Beautiful charts for Angular based on Chart.js
http://valor-software.github.io/ng2-charts/
MIT License
2.35k stars 573 forks source link

Calling Chart.js methods #316

Closed CraigHarley closed 5 years ago

CraigHarley commented 8 years ago

Hi, it says this chart is based on Chart.js, how would I go about accessing methods such as .addData() and .removeData(), so as to allow live updates.

Thanks!

brandonreid commented 8 years ago

@CraigHarley Just update the data and it should update the chart. See the "Line Chart" example on the ng2-charts site and click the button that says "CLICK".

jarnix commented 8 years ago

Hello,

The Line Chart example shows how to update the values but does not show how to get access to the methods of Charts.js.

I solved it on my side by disabling animation (like on the example) but it's not like in this Chartjs example : http://jsbin.com/yitep/5/edit?html,js,output

jarnix commented 8 years ago

For reference/example, this Angular2 HighCharts implementation does this : https://github.com/gevgeny/angular2-highcharts#dynamic-interaction-with-chart-object

It's far from perfect but it gives you access to the Highcharts object.

CraigHarley commented 8 years ago

Thanks @jarnix that's exactly what I'm looking for

jarnix commented 8 years ago

This does not answer your question though (and I need the same thing), the reference was intended as a suggestion for the developers.

paviad commented 5 years ago

Closing for inactivity. If this is still an issue, please provide an example showing the current behavior and describe the expected behavior.