Graph: Fix to legend value Max and negative values, Fixes #1136

pull/1159/head
Torkel Ödegaard 11 years ago
parent 62b58d8bb0
commit ed2ca5fced
  1. 1
      CHANGELOG.md
  2. 4
      src/app/components/timeSeries.js
  3. 8
      src/test/specs/timeSeries-specs.js

@ -4,6 +4,7 @@
- [Issue #1087](https://github.com/grafana/grafana/issues/1087). Panel: Fixed IE9 crash due to angular drag drop
- [Issue #1093](https://github.com/grafana/grafana/issues/1093). SingleStatPanel: Fixed position for drilldown link tooltip when dashboard requires scrolling
- [Issue #1095](https://github.com/grafana/grafana/issues/1095). DrilldownLink: template variables in params property was not interpolated
- [Issue #1136](https://github.com/grafana/grafana/issues/1136). Graph: Fix to legend value Max and negative values
# 1.9.0-rc1 (2014-11-17)

@ -64,7 +64,7 @@ function (_, kbn) {
var result = [];
this.stats.total = 0;
this.stats.max = Number.MIN_VALUE;
this.stats.max = -Number.MAX_VALUE;
this.stats.min = Number.MAX_VALUE;
this.stats.avg = null;
this.stats.current = null;
@ -106,7 +106,7 @@ function (_, kbn) {
this.stats.timeStep = this.datapoints[1][1] - this.datapoints[0][1];
}
if (this.stats.max === Number.MIN_VALUE) { this.stats.max = null; }
if (this.stats.max === -Number.MAX_VALUE) { this.stats.max = null; }
if (this.stats.min === Number.MAX_VALUE) { this.stats.min = null; }
if (result.length) {

@ -35,6 +35,14 @@ define([
expect(series.stats.current).to.be(10);
});
it('max value should work for negative values', function() {
series = new TimeSeries({
datapoints: [[-10,1], [-4, 2]]
});
series.getFlotPairs('null', yAxisFormats);
expect(series.stats.max).to.be(-4);
});
});
describe('series overrides', function() {

Loading…
Cancel
Save