From acc28245adcf74d845397161e7774d1e93c7bdbc Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Tue, 27 May 2025 12:15:06 +0300 Subject: [PATCH 1/2] UI: Hide zero tooltip for time series charts --- .../chart/time-series-chart-basic-config.component.html | 5 +++++ .../chart/time-series-chart-basic-config.component.ts | 4 ++++ .../widget/lib/chart/time-series-chart-tooltip.models.ts | 9 ++++++++- .../time-series-chart-widget-settings.component.html | 5 +++++ .../chart/time-series-chart-widget-settings.component.ts | 3 +++ ui-ngx/src/assets/locale/locale.constant-en_US.json | 1 + 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html index 61c9f89c7c..ddf7216896 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html @@ -311,6 +311,11 @@ +
+ + {{ 'tooltip.hide-zero-false-tooltip-values' | translate }} + +
{{ 'tooltip.background-color' | translate }}
+
+ + {{ 'tooltip.hide-zero-false-tooltip-values' | translate }} + +
{{ 'tooltip.background-color' | translate }}
Date: Thu, 29 May 2025 11:06:51 +0300 Subject: [PATCH 2/2] UI: Refactoring --- .../widget/lib/chart/time-series-chart-tooltip.models.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-tooltip.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-tooltip.models.ts index f40e95276e..713e7b9373 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-tooltip.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-tooltip.models.ts @@ -130,11 +130,7 @@ export class TimeSeriesChartTooltip { this.renderer.appendChild(tooltipItemsElement, this.constructTooltipDateElement(items[0].param, interval)); } for (const item of items) { - if (this.settings.tooltipHideZeroFalse) { - if (item.param.value[1]) { - this.renderer.appendChild(tooltipItemsElement, this.constructTooltipSeriesElement(item)); - } - } else { + if (!this.settings.tooltipHideZeroFalse || item.param.value[1]) { this.renderer.appendChild(tooltipItemsElement, this.constructTooltipSeriesElement(item)); } }