1
0
Fork 0

autoscaling graphs

This commit is contained in:
Heiko Kernbach 2013-09-03 19:03:30 +02:00
parent 106aa13f5f
commit 885896a323
1 changed files with 11 additions and 0 deletions

View File

@ -302,7 +302,18 @@ var dashboardView = Backbone.View.extend({
}
},
checkMaxValue: function (identifier) {
var maxValue = 0;
$.each(this.seriesData[identifier].values, function (k,v) {
if (v.y > maxValue) {
maxValue = v.y;
}
});
this.seriesData[identifier].max = maxValue;
},
getMaxValue : function (identifier) {
this.checkMaxValue(identifier);
var max = this.seriesData[identifier].max || 1;
var i = 0, n = this.units.length;