angular-chartjs icon indicating copy to clipboard operation
angular-chartjs copied to clipboard

setting scaleStepWidth dynamically?

Open crolfe opened this issue 11 years ago • 4 comments

I'm trying to set scaleStepWidth dynamically on a line graph (based on a maximum value in my dataset), and am having difficulty getting the chart to recognize that I've done so.

If I hard code a value for scaleStepWidth in the options object (plus scaleStepOverride=true and scaleSteps=20), the chart scales exactly as expected. If I try to set the chart options after I've received the dataset in the controller, then the chart appears to display using the default settings.

Is this happening because the view needs to be recompiled to reflect the changes to the options?

crolfe avatar Jul 16 '14 15:07 crolfe

Possibly yes. Also could be something about the auto-sizing interfering with the scaling options.

This will be fixed soon as I am going to remove that drawing logic entirely since it is now supported natively by ChartJS, hang with me :)

txbm avatar Jul 16 '14 16:07 txbm

Sure thing. I found a workaround using ng-repeat after the dataset is ready, but that feels like cheating :)

crolfe avatar Jul 16 '14 21:07 crolfe

Yeah that confirms it's a watch/apply issue though thank you.

txbm avatar Jul 16 '14 21:07 txbm

I have narrowed down the exact cause of this issue and it will be fixed shortly.

txbm avatar Sep 02 '14 03:09 txbm