tooltip: {
trigger: 'axis',
triggerOn: 'none',
axisPointer: {
type: 'shadow',
label: {
show: true
},
shadowStyle: {
color: '#e4e7ed80'
}
},
}
myChart.dispatchAction({
type: 'showTip',
seriesIndex: _this.seriesIndex,
dataIndex: _this.dataIndex
})
myChart.dispatchAction({
type: 'hideTip'
})
xAxis:[
{
axisPointer: {
handle: {
show: true,
size: 0
},
value: _this.mapArea,
label: {
show: false
}
},
}
]
datazoom事件 想让如果选中列不在屏幕数据范围内消失选中阴影色,实际不生效
myChart.on('datazoom', function(params) {
debugger
let xAxis = myChart.getModel().option.dataZoom[0]
console.log(params, xAxis, 'datazoom', '<<<<~~~~~~~~~~~~~~~~~~~')
const start = xAxis.startValue
const end = xAxis.endValue
myChart.dispatchAction({
type: 'hideTip'
})
// if (start < _this.dataIndex || _this.dataIndex > end) {
// console.log('~~~~~~~~~~~~~>>>>', 'start')
// setTimeout(() => {
// myChart.dispatchAction({
// type: 'hideTip'
// })
// }, 0)
// } else {
// setTimeout(() => {
// myChart.dispatchAction({
// type: 'showTip',
// seriesIndex: _this.seriesIndex || 0,
// dataIndex: _this.dataIndex || 0
// })
// }, 1000)
// }
})
看了下,题主这个阴影应该是
axisPointer
的,不是tooltip
的所以用
setOtion
即可