Commit 6603d6f1a4d380398140e71c4ac9f6eb7b562577

Authored by VoBa
Committed by GitHub
2 parents 169d12db 46487aa5

Merge pull request #3196 from ChantsovaEkaterina/bug/flot-attributes-usage-in-labels

[3.0] Flot: attributes usage in labels. 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 {
@@ -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,