title: Repeated animations with eCharts
body: <p>I'm using eCharts to plot some scatterplots. I have several data series, and what I want is for each one to sequentially appear following an animation of my choice. What's happening instead is that the first series animates by my choice, but the subsequent ones revert to the default animation, even though (as far as I can see) I'm still defining the animation for them.</p>
  
  <p>Following is the shortest complete example I can make ...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var chartOptions = function(seriesData) {
    let option = {
      xAxis: {
        min: 0,
        max: 11
      },
      yAxis: {
        min: 0,
        max: 11
      },
      series: [{
        name: "Series 1",
        type: 'scatter',
        data: seriesData,
        color: "red",
        animationDelay: function(idx) {
          return idx * 250;
        },
        animationEasingUpdate: "linear"
      }, ]
    };
    return option;
  };
  
  var nextSeries = function(seriesData) {
    let series = {
      series: [{
        name: "Next series",
        type: 'scatter',
        data: seriesData,
        color: "blue",
        animationDelay: function(idx) {
          return idx * 250;
        },
        animationEasingUpdate: "linear"
      }, ]
    };
    return series;
  };
  
  var series1 = [
    [1, 1],
    [2, 2],
    [3, 3],
    [4, 4],
    [5, 5]
  ];
  var series2 = [
    [10, 10],
    [9, 9],
    [8, 8],
    [7, 7],
    [6, 6]
  ];
  var series3 = [
    [10, 10],
    [1, 1],
    [8, 8],
    [2, 2],
    [6, 6]
  ];
  var seriesAll = [series1, series2, series3]
  
  var options = chartOptions(series1);
  var chart1 = echarts.init(document.getElementById("ChartView"));
  chart1.setOption(options);
  var i = 0;
  var timer = setInterval(function() {
    i++;
    if (i &gt;= seriesAll.length) {
      clearInterval(timer)
    } else {
      var nextOptions = nextSeries(seriesAll[i])
      chart1.setOption(nextOptions);
    };
  }, 2000);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.1.0/echarts-en.js"&gt;&lt;/script&gt;
  
  
  &lt;div id="ChartView" style="height:300px;max-width:300px;"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>