Set Animation speed - ChartJS?

Ich versuche, um die animation Geschwindigkeit von einem Kreisdiagramm in chartJS.

Ich habe versucht, die folgenden:

  1. numSteps: Anzahl,

  2. animationSteps: Anzahl

    3.Chart.Standardwerte.global.animationSteps = Anzahl;

Keiner dieser änderung der Geschwindigkeit. Irgendwelche Ratschläge?

 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);
  • hi, hast du versucht Diagramm.Standardwerte.global.animation.duration = 3000; ?
  • Wow. das funktionierte perfekt! Danke!!!!
  • wird dies nicht ändern-animation Dauer für alle in den Diagrammen auf der Seite ?
Schreibe einen Kommentar