tbuckham

Updating charts with $scope changes in Angular

4 posts in this topic

Hi all

I've been taking a look at one of the sample Fusion Charts with Angular here - http://www.fusioncharts.com/angularjs-charts/#/demos/ex8

The example is easy to follow, with a dynamic change in the charts once you activate the function to change some of the data in the $scope. I've implemented something similar, and whilst I can see that the $scope value is being updated (via printing the value before and after the click event), the charts itself does not redraw and the previous $scope value remains. Is this something people have encountered problems with before?

See images for an example. I can post the code if useful, however the fact the $scope can be seen as getting updated, suggests some other issues perhaps?

Cheers

 

Tom


original scope and view.png

 

 

 

updated scope view.png

Edited by tbuckham

Share this post


Link to post
Share on other sites

Hi,

In order to update the value of vertical bullet chart , you need to traverse the datasource object and the update the data value.

Please refer this documentation link for details http://www.fusioncharts.com/dev/using-with-javascript-libraries/angularjs/configuring-charts-using-the-angularjs-scope-object.html

Also for further reference please check this sample fiddle - http://jsfiddle.net/e427pdex/ 

Share this post


Link to post
Share on other sites

Thanks for the reply! I check through your code, which looked similar to what I was doing, but I eventually realised the issue was using multiple controllers and not having them assigned to the correct divs. Once I moved the controller up to the container div it worked properly!

Cheers

Tom

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...