Commit ee447bc1b0617358f60c587f786e18b57a4946d8

Authored by Chantsova Ekaterina
1 parent 527bc5e2

Flot: fix thresholds appearing when threshold attribute is not set

... ... @@ -24,6 +24,7 @@ import {
24 24 isDefinedAndNotNull,
25 25 isEqual,
26 26 isNumber,
  27 + isNumeric,
27 28 isUndefined
28 29 } from '@app/core/utils';
29 30 import { IWidgetSubscription, WidgetSubscriptionOptions } from '@core/api/widget-api.models';
... ... @@ -841,7 +842,7 @@ export class TbFlot {
841 842 data.forEach((keyData) => {
842 843 if (keyData && keyData.data && keyData.data[0]) {
843 844 const attrValue = keyData.data[0][1];
844   - if (isFinite(attrValue)) {
  845 + if (isNumeric(attrValue) && isFinite(attrValue)) {
845 846 const settings: TbFlotThresholdKeySettings = keyData.dataKey.settings;
846 847 const colorIndex = this.subscription.data.length + allThresholds.length;
847 848 this.generateThreshold(allThresholds, settings.yaxis, settings.lineWidth, settings.color, colorIndex, attrValue);
... ...