From d3183fc32eb4ef12c0645b05c0b4e35e708caaeb Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Mon, 27 Dec 2021 14:36:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20echarts=20=E5=9B=BE=E8=A1=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20className=20=E8=B0=83=E6=95=B4=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E7=A7=BB=E5=85=A5=E5=BC=B9=E6=A1=86=E4=B8=BB=E9=A2=98=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/assets/css/common.scss | 5 +++++ nezha-fronted/src/components/chart/chart/options/chartBar.js | 3 ++- .../src/components/chart/chart/options/chartGauge.js | 3 ++- nezha-fronted/src/components/chart/chart/options/chartPie.js | 3 ++- .../src/components/chart/chart/options/chartTimeSeries.js | 3 ++- .../src/components/chart/chart/options/chartTreemap.js | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss index ef0bbacbd..59127366c 100644 --- a/nezha-fronted/src/assets/css/common.scss +++ b/nezha-fronted/src/assets/css/common.scss @@ -363,3 +363,8 @@ td .nz-icon-gear:before{ } } } +.chart-bar,.chart-gauge,.chart-time-series,.chart-treemap,.chart-pie { + background-color: $--chart-background-color !important; + border-color: $--chart-border-color !important; + color: $--color-text-regular !important; +} diff --git a/nezha-fronted/src/components/chart/chart/options/chartBar.js b/nezha-fronted/src/components/chart/chart/options/chartBar.js index 75b6c0648..85cbc4225 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartBar.js +++ b/nezha-fronted/src/components/chart/chart/options/chartBar.js @@ -6,7 +6,8 @@ const chartBarOption = { extraCssText: 'z-index:1000;', z: 9, animation: false, - appendToBody: true + appendToBody: true, + className: 'chart-bar' }, legend: { show: false diff --git a/nezha-fronted/src/components/chart/chart/options/chartGauge.js b/nezha-fronted/src/components/chart/chart/options/chartGauge.js index a6d928d98..4977610a8 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartGauge.js +++ b/nezha-fronted/src/components/chart/chart/options/chartGauge.js @@ -6,7 +6,8 @@ const chartGaugeOption = { extraCssText: 'z-index:1000;', z: 9, animation: false, - appendToBody: true + appendToBody: true, + className: 'chart-gauge' }, series: [ { diff --git a/nezha-fronted/src/components/chart/chart/options/chartPie.js b/nezha-fronted/src/components/chart/chart/options/chartPie.js index 79524c40a..a7410e867 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartPie.js +++ b/nezha-fronted/src/components/chart/chart/options/chartPie.js @@ -6,7 +6,8 @@ const chartPieOption = { extraCssText: 'z-index:1000;', z: 9, animation: false, - appendToBody: true + appendToBody: true, + className: 'chart-pie' }, legend: { show: false diff --git a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js index 06f9fc0c4..fc47e9bf8 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js +++ b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js @@ -37,7 +37,8 @@ export const chartTimeSeriesLineOption = { extraCssText: 'z-index:99999999;', z: 9, animation: false, - appendToBody: true + appendToBody: true, + className: 'chart-time-series' // formatter: 动态生成 }, color: initColor(), diff --git a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js index b38d1e55d..06abb88d7 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js +++ b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js @@ -8,6 +8,7 @@ const chartTreemapOption = { z: 9, animation: false, appendToBody: true, + className: 'chart-treemap', formatter: function (info) { const value = info.value const treePathInfo = info.treePathInfo