写了一个折线图,但是数据太多,所以加了dataZoom,之后又要一个页面显示固定长度,所以endValue要加限制。
官方文档:https://echarts.apache.org/zh/option.html#dataZoom-inside.endValue
放代码:
setChartOptions (charts) {
option = {
tooltip: {
show: true,
trigger: 'axis',
confine: true
},
legend: {
show: false
},
grid: {
left: '2%',
right: '10%',
bottom: '5%',
containLabel: true,
top: '20',
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.data.lineData.category,
splitLine: {
lineStyle: {
type: 'dashed'
}
}
},
yAxis: {
type: 'value'
},
dataZoom: [{
show: true,
type: