需求:Earchs柱状图轮播,每次轮播移动一个
效果图:
参考代码:
https://www.isqqw.com/echartsdetail?id=17648
代码:在option下面写setInterval
setInterval(() => {
let x0 = this.option.xAxis[0].data[0];
let s0 = this.option.series[0].data[0];
this.option.xAxis[0].data.shift();
this.option.xAxis[0].data.push(x0);
this.option.series[0].data.shift();
this.option.series[0].data.push(s0);
}, 2000);