diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 3e543bc..4310ca4 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -237,25 +237,29 @@ const initLineVandDChart = (data, xData) => { tooltip: { trigger: 'item', }, - legend: { - type: 'scroll', - orient: 'vartical', - // x: "right", - top: 'center', - right: '15', - // bottom: "0%", - itemWidth: 16, - itemHeight: 8, - itemGap: 10, - textStyle: { - color: '#000000', - fontSize: 100, - fontWeight: 0, - }, - data: xData, - }, + grid:{ + right: '20%', // 保留足够的空间 + left: '5%', + top: '10%', + bottom: '10%' + }, + legend: { + type: 'scroll', + orient: 'vertical', // 修正为 vertical + top: 'center', + right: '15%', // 这里需要加上百分比符号 + itemWidth: 16, + itemHeight: 8, + itemGap: 10, + textStyle: { + color: '#000000', + fontSize: 12, // 建议调整为合适的字体大小,100 可能过大 + fontWeight: 'normal' // 通常使用 'normal' 或 'bold' + }, + data: xData, + }, polar: { - center: ['30%', '56%'], + center: ['40%', '56%'], }, angleAxis: { interval: 1, @@ -309,7 +313,7 @@ const initLineVandDChart = (data, xData) => { series: [ { type: 'pie', - center: ['30%', '56%'], + center: ['40%', '56%'], radius: ['5%', '10%'], hoverAnimation: false, labelLine: { @@ -336,7 +340,7 @@ const initLineVandDChart = (data, xData) => { }, { type: 'pie', - center: ['30%', '56%'], + center: ['40%', '56%'], radius: ['80%', '85%'], hoverAnimation: false, labelLine: { @@ -366,7 +370,7 @@ const initLineVandDChart = (data, xData) => { { stack: 'a', type: 'pie', - center: ['30%', '56%'], + center: ['40%', '56%'], radius: ['20%', '80%'], roseType: 'area', zlevel: 10, @@ -515,14 +519,14 @@ const initPieChart2 = (seriesData) => { grid: { top: '15%', left: 0, - right: '1%', + right: '15%', bottom: 5, containLabel: true, }, legend: { orient: 'vertical', top: 'center', - right: 50, + right: "10%", textStyle: { align: 'left', verticalAlign: 'middle', @@ -549,7 +553,7 @@ const initPieChart2 = (seriesData) => { { name: '需求类型占比', type: 'pie', - center: ['30%', '50%'], + center: ['40%', '50%'], radius: ['40%', '65%'], label: { normal: {