diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index ba3dcda390e..067c85cc3a4 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -470,5 +470,5 @@ function parseHistogramLabel(le: string): number { if (le === '+Inf') { return +Infinity; } - return parseInt(le); + return Number(le); } diff --git a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts index 89b1f1c714e..133193e1369 100644 --- a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts +++ b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts @@ -86,7 +86,7 @@ function parseHistogramLabel(label: string): number { if (label === '+Inf') { return +Infinity; } - return parseInt(label); + return Number(label); } /** diff --git a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts index 32e7bd7ca11..0ef1832e7e6 100644 --- a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts +++ b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts @@ -116,11 +116,12 @@ export class HeatmapTooltip { if (yData) { if (yData.bounds) { if (data.tsBuckets) { + const decimals = this.panelCtrl.decimals || 0; const tickFormatter = valIndex => { let valueFormatted = data.tsBuckets[valIndex]; if (!_.isNaN(_.toNumber(valueFormatted)) && valueFormatted !== '') { // Try to format numeric tick labels - valueFormatted = this.bucketBoundFormatter(0)(valueFormatted); + valueFormatted = this.bucketBoundFormatter(decimals)(_.toNumber(valueFormatted)); } return valueFormatted; }; @@ -290,7 +291,12 @@ export class HeatmapTooltip { bucketBoundFormatter(decimals, scaledDecimals = null) { let format = this.panel.yAxis.format; return function(value) { - return kbn.valueFormats[format](value, decimals, scaledDecimals); + try { + return format !== 'none' ? kbn.valueFormats[format](value, decimals, scaledDecimals) : value; + } catch (err) { + console.error(err.message || err); + return value; + } }; } } diff --git a/public/app/plugins/panel/heatmap/partials/axes_editor.html b/public/app/plugins/panel/heatmap/partials/axes_editor.html index 61ab48026d3..d97bb0361d0 100644 --- a/public/app/plugins/panel/heatmap/partials/axes_editor.html +++ b/public/app/plugins/panel/heatmap/partials/axes_editor.html @@ -24,12 +24,12 @@ -