_updateSeries(newSeries, animate, overwriteInitialSeries = false) {
    return new Promise((resolve) => {
      const w = this.w

      w.globals.shouldAnimate = animate

      w.globals.dataChanged = true

      if (animate) {
        this.ctx.series.getPreviousPaths()
      }

      let existingSeries

      // axis charts
      if (w.globals.axisCharts) {
        existingSeries = newSeries.map((s, i) => {
          return this._extendSeries(s, i)
        })

        if (existingSeries.length === 0) {
          existingSeries = [{ data: [] }]
        }
        w.config.series = existingSeries
      } else {
        // non-axis chart (pie/radialbar)
        w.config.series = newSeries.slice()
      }

      if (overwriteInitialSeries) {
        w.globals.initialConfig.series = Utils.clone(w.config.series)
        w.globals.initialSeries = Utils.clone(w.config.series)
      }
      return this.ctx.update().then(() => {
        resolve(this.ctx)
      })
    })
  }
Private method to update Series.

@param {array} series - New series which will override the existing