标签:data param chart his more 旋转 isp 颜色 highlight
onChartClick(param) {
//切换图标时计算角度
let dataIndex = param.dataIndex;
let angle = 0;
//计算起始扇形角度
if (dataIndex == 0) {
this.radarOptionConfig.series[0].startAngle = this.percentArrary[0] / 2;
// this.onChartDispatch = { type: "downplay" };
} else {
for (let i = 0; i <= dataIndex; i++) {
angle += this.percentArrary[i];
}
let moreAngle = angle - this.percentArrary[dataIndex] / 2;
this.radarOptionConfig.series[0].startAngle = moreAngle;
// console.log(dataIndex);
}
//点击切换表格数据
this.tableData = this.newVIPdataArr[dataIndex];
this.navTitle = this.tableData.name;//图标对应数据显示在表格中
this.triangle = "triangle" + (dataIndex % 5); //图标上三角形指示器切换颜色
//点击控制高亮
let obj =
(this.radarOptionConfig &&
this.radarOptionConfig.series &&
this.radarOptionConfig.series[0] &&
this.radarOptionConfig.series[0].data) ||
[];
const chart = this.$refs["chartContainer"].chart;
obj.forEach((_, i) => {
console.log(i, dataIndex);
if (i === dataIndex) {
chart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex
});
this.clickdataindex = i;
} else {
chart.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: i
});
}
});
},
标签:data param chart his more 旋转 isp 颜色 highlight
原文地址:https://www.cnblogs.com/sinceForever/p/12146260.html