From d7082c3959c18f11744fac204ef9bc274a5986d2 Mon Sep 17 00:00:00 2001 From: Linquize Date: Sun, 3 Jan 2016 12:59:43 +0800 Subject: [PATCH] Show maximum 10 steps of chart --- app/shared/services.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/shared/services.js b/app/shared/services.js index 780726fd5..805f1e399 100644 --- a/app/shared/services.js +++ b/app/shared/services.js @@ -225,6 +225,7 @@ angular.module('dockerui.services', ['ngResource']) max = map[k]; } } + var steps = Math.min(max, 10); var dataset = { fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,1)", @@ -237,10 +238,11 @@ angular.module('dockerui.services', ['ngResource']) datasets: [dataset] }, { - scaleStepWidth: 1, + scaleStepWidth: Math.ceil(max / steps), pointDotRadius: 1, + scaleIntegersOnly: true, scaleOverride: true, - scaleSteps: max + scaleSteps: steps }); } };