Commit 51462e80179db938eef0cbb77ea5516ee4d6d626

Authored by Chantsova Ekaterina
1 parent 169d12db

Fix error on subscribing on attributes, that will be used in labels

@@ -158,6 +158,7 @@ export interface TbFlotCustomLegendSettings { @@ -158,6 +158,7 @@ export interface TbFlotCustomLegendSettings {
158 export interface TbFlotLabelPatternSettings { 158 export interface TbFlotLabelPatternSettings {
159 name: string; 159 name: string;
160 type: DataKeyType; 160 type: DataKeyType;
  161 + settings?: any;
161 } 162 }
162 163
163 export interface TbFlotGraphSettings extends TbFlotBaseSettings, TbFlotThresholdsSettings, TbFlotComparisonSettings, TbFlotCustomLegendSettings { 164 export interface TbFlotGraphSettings extends TbFlotBaseSettings, TbFlotThresholdsSettings, TbFlotComparisonSettings, TbFlotCustomLegendSettings {
@@ -42,7 +42,7 @@ import { @@ -42,7 +42,7 @@ import {
42 flotSettingsSchema, 42 flotSettingsSchema,
43 TbFlotAxisOptions, 43 TbFlotAxisOptions,
44 TbFlotHoverInfo, 44 TbFlotHoverInfo,
45 - TbFlotKeySettings, 45 + TbFlotKeySettings, TbFlotLabelPatternSettings,
46 TbFlotPlotAxis, 46 TbFlotPlotAxis,
47 TbFlotPlotDataSeries, 47 TbFlotPlotDataSeries,
48 TbFlotPlotItem, 48 TbFlotPlotItem,
@@ -383,6 +383,9 @@ export class TbFlot { @@ -383,6 +383,9 @@ export class TbFlot {
383 if (this.settings.customLegendEnabled) { 383 if (this.settings.customLegendEnabled) {
384 this.labelPatternsSourcesData = []; 384 this.labelPatternsSourcesData = [];
385 const labelPatternsDatasources: Datasource[] = []; 385 const labelPatternsDatasources: Datasource[] = [];
  386 + this.settings.dataKeysListForLabels.forEach((item) => {
  387 + item.settings = {};
  388 + });
386 subscription.datasources.forEach((item) => { 389 subscription.datasources.forEach((item) => {
387 let datasource: Datasource = { 390 let datasource: Datasource = {
388 type: item.type, 391 type: item.type,