From 5f17af2e88480bee53d07194366994066cbb02f4 Mon Sep 17 00:00:00 2001 From: likexuan Date: Tue, 26 Jul 2022 17:58:16 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2064=20peaf=20:=20=E9=80=9A=E8=BF=87d3js=20?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20pie=20chart=20=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart.vue | 18 +- .../src/components/chart/chart/chartPieD3.vue | 360 ++++++++++++++++++ .../src/components/chart/chart/tools.js | 3 + .../src/components/common/js/constants.js | 1 + 4 files changed, 379 insertions(+), 3 deletions(-) create mode 100644 nezha-fronted/src/components/chart/chart/chartPieD3.vue diff --git a/nezha-fronted/src/components/chart/chart.vue b/nezha-fronted/src/components/chart/chart.vue index b4ebaf6c7..041f3d777 100644 --- a/nezha-fronted/src/components/chart/chart.vue +++ b/nezha-fronted/src/components/chart/chart.vue @@ -17,7 +17,7 @@ :showAllData="showAllData" @chartIsNoData="chartIsNoData" > - + > --> + +
+
+
+
+ {{ tooltip.title }} +
+
+
value
+
+
+ +
+
{{ tooltip.value }}
+
+
+
+
+ + + + + diff --git a/nezha-fronted/src/components/chart/chart/tools.js b/nezha-fronted/src/components/chart/chart/tools.js index cd425d4a1..8151966d1 100644 --- a/nezha-fronted/src/components/chart/chart/tools.js +++ b/nezha-fronted/src/components/chart/chart/tools.js @@ -65,6 +65,9 @@ export function isTimeSeries (type) { export function isHexagon (type) { return type === chartType.hexagon } +export function isPieD3 (type) { + return type === chartType.PieD3 +} export function isChartPie (type) { return type === chartType.pie } diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index 8b863410f..e16a52a04 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -420,6 +420,7 @@ export const chartType = { topology: 'topology', map: 'map', hexagon: 'hexagon', + PieD3: 'pie', topologyLink: 'topologyLink' }