x轴axisTick中的interval怎么间隔四个显示刻度尺
配置项如下
option = {
grid:{
left: '3%',
right: '4%',
bottom: 150,
//containLabel: true
},
dataZoom: [{
type: 'slider',
filterMode: 'weakFilter',
showDataShadow: false,
xAxisIndex: [0,1],
bottom: 30,
height: 20,
borderColor: 'transparent',
backgroundColor: '#e2e2e2',
handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line
handleSize: 20,
handleStyle: {
shadowBlur: 6,
shadowOffsetX: 1,
shadowOffsetY: 2,
shadowColor: '#aaa'
},
rangeMode:['value', 'percent']
// labelFormatter: ''
}],
yAxis: {
type : 'value',
},
xAxis : [
{
type : 'category',
data : ['2017Q1','2017Q2','2017Q3','2017Q4','2018Q1','2018Q2','2018Q3','2018Q4','2019Q1','2019Q2','2019Q3','2019Q4',],
boundaryGap: true,
axisTick: {
show:true,
alignWithLabel: false,
interval: 0,
},
axisLabel:{
show: true,
interval: 0,
}
},
{
type : 'category',
position: 'bottom',
data :['人保财险1','人保财险12','人保财险3','人保财险4','人保财险5','人保财险6','人保财险7','人保财险8','人保财险9','人保财险10','人保财险11','人保财险12'],
boundaryGap: true,
axisLabel:{
interval: function(param,value){
/*if(value ==undefined){
return true
}*/
console.log(param);
/*if(param==2){
return true
}*/
return (param+2)%4 ===0;
},
margin: 50,
},
axisTick: {
show:true,
length: 110,
alignWithLabel: false,
//interval: 0,
interval: function(param,value){
if(value ==undefined){
return true
}
return param%4 ===0;
},
},
}
],
series: [{
type: 'bar',
xAxisIndex: [0,1],
data:[220, 182, 191, 234, 290,170,300, 191,170,300, 191,170],
}, {
type: 'bar',
xAxisIndex: [0,1],
data:[210, 132, 91, 204, 220,170,300, 191,170,300, 191,170],
}, {
type: 'bar',
xAxisIndex: [0,1],
data:[120, 132, 131, 254, 278,170,300, 191,170,300, 191,170],
}],
};