[Chartjs]-AngularJS Charts not updating data correctly

2👍

As posted here

The problem seems to be caused because of DOM manipulation

Using ng-if or ng-switch instead of ng-show solves the problem

1👍

As per documentation you can try this…
If you want to reload the canvas send a broadcast using:

$scope.$broadcast("$reload", {});

This wil repaint the charts (for example when a chart became visible)

1👍

I’ve got this issue a couple of time.

Just put your update chart code in a new function like “updateChart” and call it using something like this :

$timeout(updateChart(data), 200)

It will solve your issue.

Edit:

Move your :

$scope.currentItem = item; 

in your timeout and it’s gonna be working 🙂

0👍

Seems (from your picture) like your selectItem is triggering repeatedly – you might want double check the trigger for that.

You might also want to check the tooltipTemplate – though you append %, it doesn’t look (from your picture) that your numbers add up to 100.

Leave a comment