From 51462e80179db938eef0cbb77ea5516ee4d6d626 Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Wed, 29 Jul 2020 21:53:46 +0300 Subject: [PATCH] Fix error on subscribing on attributes, that will be used in labels --- .../modules/home/components/widget/lib/flot-widget.models.ts | 1 + .../app/modules/home/components/widget/lib/flot-widget.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts index 5afdcf2305..5a1c921f88 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts @@ -158,6 +158,7 @@ export interface TbFlotCustomLegendSettings { export interface TbFlotLabelPatternSettings { name: string; type: DataKeyType; + settings?: any; } export interface TbFlotGraphSettings extends TbFlotBaseSettings, TbFlotThresholdsSettings, TbFlotComparisonSettings, TbFlotCustomLegendSettings { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts index 1d00ee307e..1a6c85a320 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts @@ -42,7 +42,7 @@ import { flotSettingsSchema, TbFlotAxisOptions, TbFlotHoverInfo, - TbFlotKeySettings, + TbFlotKeySettings, TbFlotLabelPatternSettings, TbFlotPlotAxis, TbFlotPlotDataSeries, TbFlotPlotItem, @@ -383,6 +383,9 @@ export class TbFlot { if (this.settings.customLegendEnabled) { this.labelPatternsSourcesData = []; const labelPatternsDatasources: Datasource[] = []; + this.settings.dataKeysListForLabels.forEach((item) => { + item.settings = {}; + }); subscription.datasources.forEach((item) => { let datasource: Datasource = { type: item.type,