diff --git a/src/views/Jyh/ecosystem/components/InfrastructureCoverageChart.vue b/src/views/Jyh/ecosystem/components/InfrastructureCoverageChart.vue index 4719ee1..413d8ca 100644 --- a/src/views/Jyh/ecosystem/components/InfrastructureCoverageChart.vue +++ b/src/views/Jyh/ecosystem/components/InfrastructureCoverageChart.vue @@ -216,18 +216,23 @@ const initInfrastructureChart = () => { } }, legend: { - data: infrastructureData.value.map(d => d.name), + data: infrastructureData.value.map(d => ({ + name: d.name, + itemStyle: { + color: d.color + } + })), orient: 'vertical', right: '5%', top: 'center', - itemWidth: 12, // 图例方块宽度 - itemHeight: 12, // 图例方块高度 - itemGap: 15, // 图例项之间的间距 - icon: 'circle', // 图例形状:'circle'圆形, 'rect'方形, 'roundRect'圆角方形 + itemWidth: 12, // 图例方块宽度 + itemHeight: 12, // 图例方块高度 + itemGap: 15, // 图例项之间的间距 + icon: 'circle', // 图例形状:'circle'圆形, 'rect'方形, 'roundRect'圆角方形 textStyle: { color: '#333', fontSize: 12, - padding: [0, 0, 0, 8] // 文字与图标的间距 + padding: [0, 0, 0, 8] // 文字与图标的间距 } }, graphic: [