this.$nextTick(() => {
// this.charts = echarts.init(this.$refs.barChart)
const barChart = this.$refs.barChart.chart
barChart.dispatchAction({
type: 'highlight',
dataIndex: 0
})
barChart.on('mouseover', function (e) {
// 当检测到鼠标悬停事件,取消默认选中高亮
barChart.dispatchAction({
type: 'downplay',
dataIndex: 0
})
})
barChart.on('mouseout', function (e) {
// 当检测到鼠标悬停事件,取消默认选中高亮
barChart.dispatchAction({
type: 'highlight',
dataIndex: 0
})
})
})
this.$nextTick(() => {
// this.charts = echarts.init(this.$refs.barChart)
const barChart2 = this.$refs.barChart2.chart
barChart2.dispatchAction({
type: 'highlight',
dataIndex: 0
})
barChart2.on('mouseover', function (e) {
// 当检测到鼠标悬停事件,取消默认选中高亮
barChart2.dispatchAction({
type: 'downplay',
dataIndex: 0
})
})
barChart2.on('mouseout', function (e) {
// 当检测到鼠标悬停事件,取消默认选中高亮
barChart2.dispatchAction({
type: 'highlight',
dataIndex: 0
})
})
})