一、问题如下
二、解决代码如下
dataZoom: [
{
yAxisIndex: [0, 1],
show: false,
type: 'slider',
startValue: 0,
endValue: configuration.endValue
}
],
yAxis: [
{
type: 'category',
inverse: true,
data: list.xAxis
},
{
type: 'category',
axisLabel: {
textStyle: {
color: '#fff',
fontSize: '12'
},
formatter: function (value) {
return ((value * 10) / 10).toLocaleString() + configuration.unit
}
},
data: list.yAxis
}
],
timeOut = setInterval(() => {
if (option.dataZoom[0].endValue === list.xAxis.length) {
option.dataZoom[0].endValue = configuration.endValue
option.dataZoom[0].startValue = 0
} else {
option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1
option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1
}
myChart.setOption(option)
}, 2000)
|