[Chartjs]-Dynamically update the options of a chart in chartjs using Javascript

23👍

I found a solution that works in case anybody googles this. Here is the thing : I was using chartjs version 1, in which the update() function doesn’t work in all cases, especially when you are trying to change the options of a chart. Therefore, switching to version 2, allowed me to use update() properly with changing the options such as :

myChart.options.scales.yAxes[0].ticks.min = someValue;

Here is a fiddle to demonstrate the solution to my problem in case anybody faces the same issue: http://jsbin.com/bamemuliyu/3/edit?html,js,output

Leave a comment