From 4d30133907ac5e4aa8d0836a2bdf52c23d8e9eb3 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Mon, 29 Nov 2021 15:43:07 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1280=20feat:=20=E6=97=B6=E9=97=B4=E5=BA=8F?= =?UTF-8?q?=E5=88=97chart=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/components/chart/chart.scss | 32 +++ .../chart/chart/chartTimeSeries.vue | 208 +++++++++++++----- .../chart/chart/options/chartTimeSeries.js | 47 +++- .../src/components/chart/chart/tools.js | 4 +- .../src/components/chart/chartMixin.js | 17 +- .../src/components/chart/testData.js | 22 +- .../src/components/common/js/common.js | 1 + .../src/components/common/js/constants.js | 2 +- 8 files changed, 262 insertions(+), 71 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index e2d0368eb..9b2cf0008 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -97,6 +97,7 @@ &.nz-chart__component--right, &.nz-chart__component--left { .legend-container { flex-direction: column; + padding-top: 25px; width: unset; max-width: 50%; max-height: unset; @@ -169,3 +170,34 @@ } } } +.nz-chart__tooltip { + .tooltip__row { + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + display: flex; + justify-content: space-between; + min-width: 150px; + max-width: 600px; + line-height: 18px; + font-size: 12px; + + .row__label { + max-width: 500px; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + + .row__color-block { + display: inline-block; + margin-right: 5px; + border-radius: 10px; + width: 15px; + height: 5px; + } + } + .row__value { + padding-left: 5px; + } + } +} diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 99c06d43c..373369f2d 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -1,5 +1,9 @@