diff options
author | Freeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace> | 2013-05-06 13:05:59 +1200 |
---|---|---|
committer | Freeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace> | 2013-05-09 01:37:18 +1200 |
commit | df750ee7702ea469ec685e303ef21ccc94b7fbae (patch) | |
tree | feb418a275940e4fc4b5651d5da6715b3e62a9ab | |
parent | 84773e385de922ced421f6a15163d282a147ec49 (diff) | |
download | manavis-df750ee7702ea469ec685e303ef21ccc94b7fbae.tar.gz manavis-df750ee7702ea469ec685e303ef21ccc94b7fbae.tar.bz2 manavis-df750ee7702ea469ec685e303ef21ccc94b7fbae.tar.xz manavis-df750ee7702ea469ec685e303ef21ccc94b7fbae.zip |
Stretch wide charts to cover remaining space
This closes #2.
-rw-r--r-- | js/mv/chart.js | 9 |
1 files 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) { |