angular-chart.js icon indicating copy to clipboard operation
angular-chart.js copied to clipboard

Dynamically change scale label

Open mazzimi opened this issue 10 years ago • 2 comments

Hello,

Inside my angular application, I fetch new data from the server via ajax and then I update the chart. It happens that the user can change the scale of the values, by multiplying them by 1000, so that the scale should change accordingly. The probblem is that I can set the "scaleLabel" using the "chart-options" in the canvas, but I did not find any way to change it dynamically.

Is it possible to do that?

Thank you, Michele

mazzimi avatar Feb 25 '16 15:02 mazzimi

The chart will be automatically updated if you change the options. Make sure you pass the options in the markup and change the corresponding option in the scope when needed.

jtblin avatar Feb 26 '16 10:02 jtblin

Hello,

I can confirm it works properly; I was using a wrong format for "option" valiable. I was adding a double quote ", around the json variable.

Thank you

mazzimi avatar Feb 26 '16 19:02 mazzimi