This is a migrated thread and some comments may be shown as answers.

Update Chart Options in Angular Controller

1 Answer 177 Views
Charts
This is a migrated thread and some comments may be shown as answers.
John Hunter
Top achievements
Rank 1
John Hunter asked on 03 Aug 2014, 10:59 PM
I have an angular application that displays a chart. When the user checks or un-checks boxes, I update the chart series accordingly and the chart redraws itself correctly. The only way I could get this to work was to use $scope.chartname.setOptions() command. Is there an alternate way of doing this so that I don't have to reference the chart object directly in my controller class?  Here is a pluker example of my current implementation: My Chart Example. I would like to change line 18 of the script.js file to not use the $scope or the direct reference to the chart.

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 04 Aug 2014, 11:42 AM
Hello,

The "official" way to do this would be the k-rebind attribute mentioned in Updating widgets when options change.

Unfortunately it doesn't work for the Chart.
We're investigating this issue, but for the moment our advice is to stick to your current approach.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
John Hunter
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or