From 9e7480c548624a04f6ac7630d644364b86c74215 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 12 十二月 2023 09:23:56 +0800 Subject: [PATCH] 样式优化整合代码 --- Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue index cffc3c5..741b537 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue @@ -36,7 +36,7 @@ ); }); - let colors = ["#91CC75", "#5470C6"]; + let colors = ['#2eadd6', '#FFA500']; const seriesData = []; for (let i = 0; i < newval.length; i++) { @@ -50,7 +50,7 @@ value: newval[i][j], itemStyle: { normal: { - barBorderRadius: borderRadius, // 璁剧疆鍦嗚 + // barBorderRadius: borderRadius, // 璁剧疆鍦嗚 color: colors[i], } }, @@ -61,10 +61,14 @@ name: seriesName, type: "bar", stack: "鎬婚噺", + barWidth: 60, data: curSeriesData, label: { show: true, - position: 'top' + position: 'top', + formatter: function (params) { + return params.value === 0 ? '' : params.value; // 鍊间负 0 涓嶆樉绀猴紝鍏朵粬鎯呭喌鏄剧ず + } }, emphasis: { focus: "series", @@ -78,7 +82,6 @@ chartName:{ handler(newval,oldval){ if(newval){ - console.log(newval) this.chartOptions.title.text = newval + "鏁版嵁缁熻" } }, -- Gitblit v1.9.3