通过dispatchAction增加选定基于坐标轴的选框,好像没有生效
配置项如下
var data = [
[1, 5],
[2, 3],
[3, 9],
[4, 7],
[5, 11],
[6, 8],
[7, 5],
[8, 9],
[9, 5],
];
option = {
title: {
text: 'dispatchAction_brush没用',
},
grid: {
left: '3%',
right: '7%',
bottom: '3%',
containLabel: true
},
tooltip: {
},
brush: {},
legend: {
data: ['', ''],
left: 'center'
},
xAxis: [{
type: 'value',
scale: true,
axisTick: true,
splitLine: {
show: false
}
}],
yAxis: [{
type: 'value',
scale: true,
axisTick: true,
splitLine: {
show: false
}
}],
dataZoom:{},
series: [{
name: '111',
type: 'line',
data: data,
}]
};
myChart.dispatchAction({
type:'brush',
areas:[{
xAxisIndex:0,
//yAxisIndex:0,
brushType:'lineX',
coordRange:[3,6],
}]
})