From 0be371a8d7905a8ace870ba0d9446cb178ea933f Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 9 Jan 2017 22:50:32 +0000 Subject: [PATCH] fit the graph? --- app/js/modules/graph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/modules/graph.js b/app/js/modules/graph.js index 93b57f2..820e505 100644 --- a/app/js/modules/graph.js +++ b/app/js/modules/graph.js @@ -42,8 +42,8 @@ let Graph = Backbone.View.extend({ var scale = 124 / ceilingLimit; // Var xstep = (280 - 46) / 100; - var xstep = 2.34; - var startX = 46 + (100 - _data.length) * xstep; + var xstep = _data.length <= 99 ? 2.34 : ~~(234 / _data.length) ; + var startX = _data.length <= 99 ? 46 + (100 - _data.length) * xstep : 46; for (var x = 0;x < _data.length;x++) {