From df750ee7702ea469ec685e303ef21ccc94b7fbae Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Mon, 6 May 2013 13:05:59 +1200 Subject: Stretch wide charts to cover remaining space This closes #2. --- js/mv/chart.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/mv/chart.js b/js/mv/chart.js index 99c67d5..e0421eb 100644 --- a/js/mv/chart.js +++ b/js/mv/chart.js @@ -1,5 +1,8 @@ var mv = function(mv) { mv.charts = {}; + var thinWidth = 250; + var medWidth = 400; + var wideWidth = Math.max(700, document.width - thinWidth - medWidth); mv.charter = function() { var charter = {}; charter.init = function() { @@ -69,17 +72,17 @@ var mv = function(mv) { }(); function wide(chart) { return chart - .width(700) + .width(wideWidth) ; } function med(chart) { return chart - .width(380) + .width(medWidth) ; } function thin(chart) { return chart - .width(250) + .width(thinWidth) ; } function short(chart) { -- cgit v1.2.3-60-g2f50