mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
Graph: fix for legend values min & max, avg & current when series only has null values, Closes #923
This commit is contained in:
parent
c6cb01aa3b
commit
db0a5bd537
@ -63,8 +63,10 @@ function (_, kbn) {
|
||||
this.yaxis = this.info.yaxis;
|
||||
|
||||
this.stats.total = 0;
|
||||
this.stats.max = -212312321312;
|
||||
this.stats.min = 212312321312;
|
||||
this.stats.max = Number.MIN_VALUE;
|
||||
this.stats.min = Number.MAX_VALUE;
|
||||
this.stats.avg = null;
|
||||
this.stats.current = null;
|
||||
|
||||
var ignoreNulls = fillStyle === 'connected';
|
||||
var nullAsZero = fillStyle === 'null as zero';
|
||||
@ -101,6 +103,9 @@ function (_, kbn) {
|
||||
this.stats.timeStep = result[1][0] - result[0][0];
|
||||
}
|
||||
|
||||
if (this.stats.max === Number.MIN_VALUE) { this.stats.max = null; }
|
||||
if (this.stats.min === Number.MAX_VALUE) { this.stats.min = null; }
|
||||
|
||||
if (result.length) {
|
||||
this.stats.avg = (this.stats.total / result.length);
|
||||
this.stats.current = result[result.length-1][1];
|
||||
|
Loading…
Reference in New Issue
Block a user