|
|
|
@ -57,7 +57,7 @@ import { |
|
|
|
} from './flot-widget.models'; |
|
|
|
import * as moment_ from 'moment'; |
|
|
|
import * as tinycolor_ from 'tinycolor2'; |
|
|
|
import { AggregationType, isHistoryTypeTimewindow } from '@shared/models/time/time.models'; |
|
|
|
import { AggregationType } from '@shared/models/time/time.models'; |
|
|
|
import { CancelAnimationFrame } from '@core/services/raf.service'; |
|
|
|
import { UtilsService } from '@core/services/utils.service'; |
|
|
|
import { DataKeyType } from '@shared/models/telemetry/telemetry.models'; |
|
|
|
@ -92,8 +92,6 @@ export class TbFlot { |
|
|
|
private readonly tooltipCumulative: boolean; |
|
|
|
private readonly hideZeros: boolean; |
|
|
|
|
|
|
|
private comparisonEnabled: boolean; |
|
|
|
|
|
|
|
private readonly defaultBarWidth: number; |
|
|
|
|
|
|
|
private thresholdsSourcesSubscription: IWidgetSubscription; |
|
|
|
@ -160,9 +158,6 @@ export class TbFlot { |
|
|
|
this.tooltipCumulative = isDefined(this.settings.tooltipCumulative) ? this.settings.tooltipCumulative : false; |
|
|
|
this.hideZeros = isDefined(this.settings.hideZeros) ? this.settings.hideZeros : false; |
|
|
|
|
|
|
|
this.comparisonEnabled = this.settings.comparisonEnabled && |
|
|
|
isHistoryTypeTimewindow(this.ctx.defaultSubscription.timeWindowConfig); |
|
|
|
|
|
|
|
const font = { |
|
|
|
color: this.settings.fontColor || '#545454', |
|
|
|
size: this.settings.fontSize || 10, |
|
|
|
@ -268,7 +263,7 @@ export class TbFlot { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.comparisonEnabled) { |
|
|
|
if (this.settings.comparisonEnabled) { |
|
|
|
const xaxis = deepClone(this.xaxis); |
|
|
|
xaxis.position = 'top'; |
|
|
|
if (this.settings.xaxisSecond) { |
|
|
|
@ -430,7 +425,7 @@ export class TbFlot { |
|
|
|
fill: keySettings.fillLines === true |
|
|
|
}; |
|
|
|
|
|
|
|
if (this.settings.stack && !this.comparisonEnabled) { |
|
|
|
if (this.settings.stack && !this.settings.comparisonEnabled) { |
|
|
|
series.stack = !keySettings.excludeFromStacking; |
|
|
|
} else { |
|
|
|
series.stack = false; |
|
|
|
@ -562,7 +557,7 @@ export class TbFlot { |
|
|
|
} |
|
|
|
this.options.xaxes[0].min = this.subscription.timeWindow.minTime; |
|
|
|
this.options.xaxes[0].max = this.subscription.timeWindow.maxTime; |
|
|
|
if (this.comparisonEnabled) { |
|
|
|
if (this.settings.comparisonEnabled) { |
|
|
|
this.options.xaxes[1].min = this.subscription.comparisonTimeWindow.minTime; |
|
|
|
this.options.xaxes[1].max = this.subscription.comparisonTimeWindow.maxTime; |
|
|
|
} |
|
|
|
@ -641,7 +636,7 @@ export class TbFlot { |
|
|
|
|
|
|
|
this.options.xaxes[0].min = this.subscription.timeWindow.minTime; |
|
|
|
this.options.xaxes[0].max = this.subscription.timeWindow.maxTime; |
|
|
|
if (this.comparisonEnabled) { |
|
|
|
if (this.settings.comparisonEnabled) { |
|
|
|
this.options.xaxes[1].min = this.subscription.comparisonTimeWindow.minTime; |
|
|
|
this.options.xaxes[1].max = this.subscription.comparisonTimeWindow.maxTime; |
|
|
|
} |
|
|
|
@ -659,7 +654,7 @@ export class TbFlot { |
|
|
|
} else { |
|
|
|
this.plot.getOptions().xaxes[0].min = this.subscription.timeWindow.minTime; |
|
|
|
this.plot.getOptions().xaxes[0].max = this.subscription.timeWindow.maxTime; |
|
|
|
if (this.comparisonEnabled) { |
|
|
|
if (this.settings.comparisonEnabled) { |
|
|
|
this.plot.getOptions().xaxes[1].min = this.subscription.comparisonTimeWindow.minTime; |
|
|
|
this.plot.getOptions().xaxes[1].max = this.subscription.comparisonTimeWindow.maxTime; |
|
|
|
} |
|
|
|
@ -1298,7 +1293,7 @@ export class TbFlot { |
|
|
|
const results: TbFlotHoverInfo[] = [{ |
|
|
|
seriesHover: [] |
|
|
|
}]; |
|
|
|
if (this.comparisonEnabled) { |
|
|
|
if (this.settings.comparisonEnabled) { |
|
|
|
results.push({ |
|
|
|
seriesHover: [] |
|
|
|
}); |
|
|
|
|