// 默认高亮
this.serviceRequestCharts.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: 0,
});
for (var i = 1; i <= 2; i++) {
this.serviceRequestCharts.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: i,
});
}
// 圆柱图上添加点击事件
var _this = this;
this.serviceRequestCharts.on("click", function (param) {
// 0"项目任务" 1部门任务 2零星任务
// this.$forceUpdate();
if (param.dataIndex != _this.dataIndex) {
//没用选中的取消高亮
_this.serviceRequestCharts.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: _this.dataIndex,
});
}
_this.dataIndex = param.dataIndex;
console.log(_this.dataIndex);
_this.serviceRequestCharts.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: _this.dataIndex,
});
});
echarts默认高亮,点击时候高亮,其它不高亮
最新推荐文章于 2024-06-25 13:39:55 发布