Fix containers, images chart scale too small

pull/2/head
User 2015-10-10 17:04:19 +08:00
parent 01db85ebc7
commit 3ac1ac6086
1 changed files with 5 additions and 1 deletions

View File

@ -215,11 +215,15 @@ angular.module('dockerui.services', ['ngResource'])
var labels = [];
data = [];
var keys = Object.keys(map);
var max = 1;
for (i = keys.length - 1; i > -1; i--) {
var k = keys[i];
labels.push(k);
data.push(map[k]);
if (map[k] > max) {
max = map[k];
}
}
var dataset = {
fillColor: "rgba(151,187,205,0.5)",
@ -236,7 +240,7 @@ angular.module('dockerui.services', ['ngResource'])
scaleStepWidth: 1,
pointDotRadius: 1,
scaleOverride: true,
scaleSteps: labels.length
scaleSteps: max
});
}
};