Browse Source

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

pull/3196/head
Chantsova Ekaterina 6 years ago
parent
commit
51462e8017
  1. 1
      ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts
  2. 5
      ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts

1
ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.models.ts

@ -158,6 +158,7 @@ export interface TbFlotCustomLegendSettings {
export interface TbFlotLabelPatternSettings { export interface TbFlotLabelPatternSettings {
name: string; name: string;
type: DataKeyType; type: DataKeyType;
settings?: any;
} }
export interface TbFlotGraphSettings extends TbFlotBaseSettings, TbFlotThresholdsSettings, TbFlotComparisonSettings, TbFlotCustomLegendSettings { export interface TbFlotGraphSettings extends TbFlotBaseSettings, TbFlotThresholdsSettings, TbFlotComparisonSettings, TbFlotCustomLegendSettings {

5
ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts

@ -42,7 +42,7 @@ import {
flotSettingsSchema, flotSettingsSchema,
TbFlotAxisOptions, TbFlotAxisOptions,
TbFlotHoverInfo, TbFlotHoverInfo,
TbFlotKeySettings, TbFlotKeySettings, TbFlotLabelPatternSettings,
TbFlotPlotAxis, TbFlotPlotAxis,
TbFlotPlotDataSeries, TbFlotPlotDataSeries,
TbFlotPlotItem, TbFlotPlotItem,
@ -383,6 +383,9 @@ export class TbFlot {
if (this.settings.customLegendEnabled) { if (this.settings.customLegendEnabled) {
this.labelPatternsSourcesData = []; this.labelPatternsSourcesData = [];
const labelPatternsDatasources: Datasource[] = []; const labelPatternsDatasources: Datasource[] = [];
this.settings.dataKeysListForLabels.forEach((item) => {
item.settings = {};
});
subscription.datasources.forEach((item) => { subscription.datasources.forEach((item) => {
let datasource: Datasource = { let datasource: Datasource = {
type: item.type, type: item.type,

Loading…
Cancel
Save