echarts的折线图,动态更新数据时折线错乱,必须要拉一下dataZoom才能恢复,请问这种情况要怎么办?
图表代码gallery
这是在vue中使用,以下是更新图表的代码片段
setUpdateOption() {
this.chart.setOption({
xAxis: [
{
type: 'category',
boundaryGap: false,
axisLine: {onZero: true},
data: this.xAxisList
}
],
yAxis: [
{
name: '销量',
max: this.sellMax,
}, {
name: '库存',
max: this.numMax,
}
],
series: [
{
name: '正常库存',
data: this.numList,
},
{
name: '瑕疵库存',
data: this.flawList,
},
{
name: '正常销量',
data: this.sellNumList
},
{
name: '瑕疵销量',
data: this.sellFlawList
}
]
});
}
在
dataZoom
中增加filterMode: 'empty'