data{
isNum: 1
}
this.isNum------------------------------第几条数据
this.rtecharts = this.
e
c
h
a
r
t
s
.
i
n
i
t
(
t
h
i
s
.
echarts.init(this.
echarts.init(this.refs.rbecharts);
this.rtecharts.clear();
this.rtecharts.showLoading();
let option={
…
tooltip: {
alwaysShowContent: true,是否常亮显示
…
}
…
}
this.rtecharts.setOption(option);
// 使用刚指定的配置项和数据显示图表。
this.rtecharts.hideLoading();
// 默认高亮第一条数据和展示第一条数据的提示框
this.rtecharts.dispatchAction({
type: ‘showTip’,
seriesIndex: 0,
dataIndex: this.isNum
});
this.rtecharts.dispatchAction({
type: ‘highlight’,
seriesIndex: 0,
dataIndex: this.isNum
});
this.rtecharts.on(‘mouseover’, (v) => {
console.log(‘mouseover’)
if (v.dataIndex !== this.isNum){
this.rtecharts.dispatchAction({
type: ‘hideTip’,
seriesIndex: 0,
dataIndex: this.isNum
});
this.rtecharts.dispatchAction({
type: ‘downplay’,
seriesIndex: 0,
dataIndex: this.isNum
});
}
});
this.rtecharts.on(‘mouseout’, (v) => {
console.log(‘mouseout’)
this.rtecharts.dispatchAction({
type: ‘showTip’,
seriesIndex: 0,
dataIndex: this.isNum
});
this.rtecharts.dispatchAction({
type: ‘highlight’,
seriesIndex: 0,
dataIndex: this.isNum
});
});