Browse Source

改饼图字体大小;加入比例显示;

songjie/feature-20260120101758-dc后台
songjie 3 weeks ago
parent
commit
bbccdeab38
  1. 19
      src/views/PlatformData/UserLoginStats.vue

19
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',

Loading…
Cancel
Save