Show maximum 10 steps of chart

pull/2/head
Linquize 2016-01-03 12:59:43 +08:00
parent 437e171639
commit d7082c3959
1 changed files with 4 additions and 2 deletions

View File

@ -225,6 +225,7 @@ angular.module('dockerui.services', ['ngResource'])
max = map[k]; max = map[k];
} }
} }
var steps = Math.min(max, 10);
var dataset = { var dataset = {
fillColor: "rgba(151,187,205,0.5)", fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,1)", strokeColor: "rgba(151,187,205,1)",
@ -237,10 +238,11 @@ angular.module('dockerui.services', ['ngResource'])
datasets: [dataset] datasets: [dataset]
}, },
{ {
scaleStepWidth: 1, scaleStepWidth: Math.ceil(max / steps),
pointDotRadius: 1, pointDotRadius: 1,
scaleIntegersOnly: true,
scaleOverride: true, scaleOverride: true,
scaleSteps: max scaleSteps: steps
}); });
} }
}; };