Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
193
rated 0 times [  195] [ 2]  / answers: 1 / hits: 20102  / 7 Years ago, thu, march 2, 2017, 12:00:00

I am trying to set the animation speed of a pie chart in chartJS.


I've tried the following:



  1. numSteps: Number



  2. animationSteps: Number



  3. Chart.defaults.global.animationSteps = Number




None of these have changed the speed. Any advice?


 var myNewChart;
var data = [
{
value: 30,
label: "hello",
color: "#F7464A"
}, {
value: 50,
color: "#E2EAE9"
}, {
value: 100,
color: "#D4CCC5"
}, {
value: 40,
color: "#949FB1"
}, {
value: 100,
color: "#4D5360"
},

];


var options = {
animation: true,
animationEasing: 'easeInOutQuart',
animationSteps: 80,
multiTooltipTemplate: "<%= datasetLabel %> - <%= value %>"

};


var ctx = document.getElementById("myChart")
.getContext("2d");

myNewChart = new Chart(ctx).Doughnut(data, options);

More From » jquery

 Answers
9

Use Chart.defaults.global.animation.duration = 3000;


[#58696] Wednesday, March 1, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ramiro

Total Points: 431
Total Questions: 96
Total Answers: 105

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
;