0👍
✅
When you change a chart’s option after it was render, you need to call the update function.
.update(duration, lazy)
Triggers an update of the chart. This can be safely called after
replacing the entire data object. This will update all scales,
legends, and then re-render the chart.
Example:
// duration is the time for the animation of the redraw in milliseconds
// lazy is a boolean. if true, the animation can be interrupted by other animations
// Would update the first dataset's value of 'March' to be 50
myLineChart.data.datasets[0].data[2] = 50;
// Calling update now animates the position of March from 90 to 50.
myLineChart.update();
1👍
I finally found a solution for my Problems.
I used a parent-controller to store my scale variable and in my Child Controllers a $watch expression to rerender each chart.
Parent:
$scope.max = 0;
$scope.setMax = function(val){
$scope.max = Math.max($scope.max, val);
console.log($scope.max);
}
Child:
$scope.$watch('max',function(){
...
});
Source:stackexchange.com