Commit 6c0f5329 by Torkel Ödegaard

Graph: improved decimal precision in legend and graph hover when graph ticks use…

Graph: improved decimal precision in legend and graph hover when graph ticks use single decimal point, now graph legend and tooltip always use one more decimal precision than axis ticks (if axis ticks has decimals), Fixes #1072
parent a677a4fe
...@@ -115,7 +115,12 @@ function (angular, $, kbn, moment, _, GraphTooltip) { ...@@ -115,7 +115,12 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
var series = data[i]; var series = data[i];
var axis = yaxis[series.yaxis - 1]; var axis = yaxis[series.yaxis - 1];
var formater = kbn.valueFormats[scope.panel.y_formats[series.yaxis - 1]]; var formater = kbn.valueFormats[scope.panel.y_formats[series.yaxis - 1]];
series.updateLegendValues(formater, axis.tickDecimals, axis.scaledDecimals + 2);
// legend and tooltip gets one more decimal precision
// than graph legend ticks
var tickDecimals = (axis.tickDecimals || -1) + 1;
series.updateLegendValues(formater, tickDecimals, axis.scaledDecimals + 2);
if(!scope.$$phase) { scope.$digest(); } if(!scope.$$phase) { scope.$digest(); }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment