From 286c96cd573c60d1af5d6d332df1825b4c600289 Mon Sep 17 00:00:00 2001 From: WX <1377869194@qq.com> Date: 星期一, 18 九月 2023 10:56:15 +0800 Subject: [PATCH] 图表样式 --- src/components/BarGraph.vue | 32 ++++++++++++-------------------- 1 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/components/BarGraph.vue b/src/components/BarGraph.vue index 72e0d0b..e6919f3 100644 --- a/src/components/BarGraph.vue +++ b/src/components/BarGraph.vue @@ -2,10 +2,7 @@ <div class="title"> {{ layerData.layerName }} </div> - <div - :id="`myEcharts${chartsId}`" - :style="{ width: width, height: height }" - ></div> + <div id="myEcharts" :style="{ width: width, height: height }"></div> </template> <script lang="ts" setup> import { @@ -27,7 +24,6 @@ width: String, height: String, layerData: Object, - chartsId: String, }); let myEcharts = echarts; let seriesData = ref([]); @@ -51,13 +47,11 @@ type: "line", smooth: true, symbol: "none", //鍙栨秷鎶樼偣鍦嗗湀 - itemStyle: { - normal: { - label: { - show: false, - position: "top", - formatter: "{c}", - }, + label: { + label: { + show: false, + position: "top", + formatter: "{c}", }, }, }); @@ -84,13 +78,11 @@ type: "line", smooth: true, symbol: "none", //鍙栨秷鎶樼偣鍦嗗湀 - itemStyle: { - normal: { - label: { - show: false, - position: "top", - formatter: "{c}", - }, + label: { + label: { + show: false, + position: "top", + formatter: "{c}", }, }, }); @@ -118,7 +110,7 @@ } function initChart() { let chart = myEcharts.init( - document.getElementById(`myEcharts${props.chartsId}`), + document.getElementById(`myEcharts`), "purple-passion" ); chart.setOption({ -- Gitblit v1.9.3