xAxis的data 是从服务端获取的,有8条,但是在series中的data只有2条,可以让x轴的下标全显示出来吗,默认只有2个
配置项如下
option = {
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top: '5',
containLabel: true
},
dataZoom: [{
type: 'inside',
startValue: 0,
endValue: 8
}],
tooltip: {
trigger: 'axis'
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: [1, 2, 3, 4, 5, 6, 7, 8],
axisTick: {
show: false
}
}],
yAxis: [{
type: 'value',
scale: true,
splitNumber: 3,
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
formatter: function(value) {
return value + '%';
}
}
}],
series: [{
name: '11111',
type: 'line',
smooth: true,
itemStyle: {
normal: {
areaStyle: {
type: 'default'
}
}
},
data: [120, 130, '-', '-', '-', '-', '-', '-']
}]
};