From a4cc93757510d897a03ac7ae585f510226a265fe Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 18 Aug 2021 18:04:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9F=A9=E5=BD=A2=E6=A0=91=E5=9B=BE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/treemap/treemap.js | 14 +++++++++++--- frontend/src/views/chart/view/ChartEdit.vue | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/chart/treemap/treemap.js b/frontend/src/views/chart/chart/treemap/treemap.js index de7c07eb49..c4b7dc719f 100644 --- a/frontend/src/views/chart/chart/treemap/treemap.js +++ b/frontend/src/views/chart/chart/treemap/treemap.js @@ -28,9 +28,17 @@ export function baseTreemapOption(chart_option, chart) { chart_option.series[0].height = (customAttr.size.treemapHeight ? customAttr.size.treemapHeight : 80) + '%' } // label - // if (customAttr.label) { - // chart_option.series[0].label = customAttr.label - // } + if (customAttr.label) { + // chart_option.series[0].label = customAttr.label + const l = { + show: true, + position: customAttr.label.position, + color: customAttr.label.color, + fontSize: customAttr.label.fontSize, + formatter: customAttr.label.show ? customAttr.label.formatter : '' + } + chart_option.series[0].label = l + } const valueArr = chart.data.series[0].data for (let i = 0; i < valueArr.length; i++) { // const y = { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index abcc82272b..fd511aecd1 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -436,7 +436,7 @@ - +