Merge pull request #168 from linquize/chart-max-steps

Show maximum 10 steps of chart
pull/2/head
Michael Crosby 2016-01-04 09:28:58 -08:00
commit 06c2ac4d5c
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
}); });
} }
}; };