diff --git a/src/pages/dashboard/base/components/MiddleChart.vue b/src/pages/dashboard/base/components/MiddleChart.vue index 11d546d..d39772c 100644 --- a/src/pages/dashboard/base/components/MiddleChart.vue +++ b/src/pages/dashboard/base/components/MiddleChart.vue @@ -97,6 +97,25 @@ const renderCountChart = () => { } countChart = echarts.init(countContainer); countChart.setOption(getPieChartDataSet(chartColors.value)); + + // 取消之前高亮的图形 + countChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: -1, + }); + // 高亮当前图形 + countChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: 1, + }); + // 显示 tooltip + countChart.dispatchAction({ + type: 'showTip', + seriesIndex: 0, + dataIndex: 1, + }); }; const renderCharts = () => { diff --git a/src/pages/dashboard/base/index.ts b/src/pages/dashboard/base/index.ts index 35a768e..1bbe05b 100644 --- a/src/pages/dashboard/base/index.ts +++ b/src/pages/dashboard/base/index.ts @@ -367,8 +367,7 @@ export function getPieChartDataSet({ emphasis: { scale: true, label: { - show: true, - formatter: ['{value|{d}%}', '{name|{b}渠道占比}'].join('\n'), + show: false, rich: { value: { color: textColor,