mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph: Fix for y axis and scaled units (GiB etc) caused rounding, for example 400 GiB instead of 378 GiB, Fixes #1251
This commit is contained in:
parent
a58330f4d8
commit
fed06ef97d
@ -6,6 +6,7 @@
|
|||||||
- [Issue #1126](https://github.com/grafana/grafana/issues/1126). InfluxDB: Support more than 10 series name segments when using alias ``$number`` patterns
|
- [Issue #1126](https://github.com/grafana/grafana/issues/1126). InfluxDB: Support more than 10 series name segments when using alias ``$number`` patterns
|
||||||
|
|
||||||
**Fixes**
|
**Fixes**
|
||||||
|
- [Issue #1251](https://github.com/grafana/grafana/issues/1251). Graph: Fix for y axis and scaled units (GiB etc) caused rounding, for example 400 GiB instead of 378 GiB
|
||||||
- [Issue #1199](https://github.com/grafana/grafana/issues/1199). Graph: fix for series tooltip when one series is hidden/disabled
|
- [Issue #1199](https://github.com/grafana/grafana/issues/1199). Graph: fix for series tooltip when one series is hidden/disabled
|
||||||
- [Issue #1207](https://github.com/grafana/grafana/issues/1207). Graphite: movingAverage / movingMedian parameter type impovement, now handles int and interval parameter
|
- [Issue #1207](https://github.com/grafana/grafana/issues/1207). Graphite: movingAverage / movingMedian parameter type impovement, now handles int and interval parameter
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ function($, _, moment) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var factor = decimals ? Math.pow(10, decimals) : 1;
|
var factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1;
|
||||||
var formatted = String(Math.round(value * factor) / factor);
|
var formatted = String(Math.round(value * factor) / factor);
|
||||||
|
|
||||||
// if exponent return directly
|
// if exponent return directly
|
||||||
|
@ -29,6 +29,13 @@ define([
|
|||||||
describeValueFormat('ns', 25, 1, 0, '25 ns');
|
describeValueFormat('ns', 25, 1, 0, '25 ns');
|
||||||
describeValueFormat('ns', 2558, 50, 0, '2.56 µs');
|
describeValueFormat('ns', 2558, 50, 0, '2.56 µs');
|
||||||
|
|
||||||
|
describe('kbn.toFixed and negative decimals', function() {
|
||||||
|
it('should treat as zero decimals', function() {
|
||||||
|
var str = kbn.toFixed(186.123, -2);
|
||||||
|
expect(str).to.be('186');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('calculateInterval', function() {
|
describe('calculateInterval', function() {
|
||||||
it('1h 100 resultion', function() {
|
it('1h 100 resultion', function() {
|
||||||
var range = { from: kbn.parseDate('now-1h'), to: kbn.parseDate('now') };
|
var range = { from: kbn.parseDate('now-1h'), to: kbn.parseDate('now') };
|
||||||
|
Loading…
Reference in New Issue
Block a user