Angular chart.js chart scale

๐Ÿ‘:-1

edit: In light of question edits this answer is not relevant.

Iโ€™m not sure If I fully understand your question, but I was having a problem with the scaling animation in angular-charts and the solution I found while checking the code behind the examples on the angular-chart site (http://jtblin.github.io/angular-chart.js/examples/app.js) was to set animation duration to 0 in the options. In Angular, using angular-charts this can be done in the controller using the chart-options directive as seen in the external linked code:

Controller

app.controller("ctrl",['$scope', function($scope){
  $scope.options = {animation: {duration: 0}};
}])

View

<canvas id="line" class="chart chart-line"
  chart-options="options"
></canvas>

Or globally using ChartJsProvider in the config method of the app:

app.config(function(ChartJsProvider) {
    ChartJsProvider.setOptions({
      animation: {duration: 0}
    });
})

I hope this helps, all of the info I posted can be found in the chart.js documentation: http://www.chartjs.org/docs/latest/configuration/animations.html

Leave a comment