diff --git a/src/views/PlatformData/UserLoginStats.vue b/src/views/PlatformData/UserLoginStats.vue index c9242b0..1ff1b31 100644 --- a/src/views/PlatformData/UserLoginStats.vue +++ b/src/views/PlatformData/UserLoginStats.vue @@ -801,6 +801,7 @@ const updateRegionBarChart = (list) => { const option = { tooltip: { trigger: 'item' }, // 之前需求:取消十字线显示,改为item + formatter: '{b}: {c}', // 柱状图不需要显示百分比 legend: { data: legendData, top: 'top' }, xAxis: { type: 'category', @@ -874,8 +875,8 @@ const updatePieChart = (chartRef, chartInstance, data) => { const option = { color: regionColors, - tooltip: { trigger: 'item' }, - legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 10 } }, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' }, + legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 14, fontWeight: 'bold' } }, series: [ { type: 'pie', @@ -990,7 +991,7 @@ const initCharts = () => { if (chartRegionBarRef.value) { const chart = echarts.init(chartRegionBarRef.value); chart.setOption({ - tooltip: { trigger: 'item' }, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' }, legend: { data: ['日活跃用户', '周活跃用户', '月活跃用户'], top: 'top' }, xAxis: { type: 'category', @@ -1010,8 +1011,8 @@ const initCharts = () => { const chart = echarts.init(chartRegionPieRef.value); chart.setOption({ color: regionColors, - tooltip: { trigger: 'item' }, - legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 10 } }, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' }, + legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 14, fontWeight: 'bold' } }, series: [ { type: 'pie', @@ -1041,8 +1042,8 @@ const initCharts = () => { const chart = echarts.init(chartRegionMemberPieRef.value); chart.setOption({ color: regionColors, - tooltip: { trigger: 'item' }, - legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 10 } }, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' }, + legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 14, fontWeight: 'bold' } }, series: [ { type: 'pie', @@ -1067,8 +1068,8 @@ const initCharts = () => { const chart = echarts.init(chartRegionNonMemberPieRef.value); chart.setOption({ color: regionColors, - tooltip: { trigger: 'item' }, - legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 10 } }, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' }, + legend: { orient: 'vertical', right: '15%', top: 'center', itemWidth: 10, itemHeight: 10, textStyle: { fontSize: 14, fontWeight: 'bold' } }, series: [ { type: 'pie',