mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
web/ui: avoid truncated Y-axis values (#6014)
* web/ui: avoid truncated Y-axis values Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Fix missing semi-colon Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
42d10aea80
commit
26e8d25e0b
File diff suppressed because one or more lines are too long
@ -738,13 +738,9 @@ Prometheus.Graph.prototype.updateGraph = function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
if (min === max) {
|
||||
self.rickshawGraph.max = max + 1;
|
||||
self.rickshawGraph.min = min - 1;
|
||||
} else {
|
||||
self.rickshawGraph.max = max + (0.1*(Math.abs(max - min)));
|
||||
self.rickshawGraph.min = min - (0.1*(Math.abs(max - min)));
|
||||
}
|
||||
var offset = 0.1 * (min === max ? max : Math.abs(max-min));
|
||||
self.rickshawGraph.max = max + offset;
|
||||
self.rickshawGraph.min = min - offset;
|
||||
}
|
||||
|
||||
var xAxis = new Rickshaw.Graph.Axis.Time({ graph: self.rickshawGraph });
|
||||
|
Loading…
Reference in New Issue
Block a user