From 961a9fff4b107a46cf22d2a327b3d6edb642cc99 Mon Sep 17 00:00:00 2001 From: Louis Bailleul Date: Fri, 20 Nov 2015 14:39:19 +0000 Subject: [PATCH] Make graph page use session variable to compute graph size --- html/includes/print-graphrow.inc.php | 5 +++-- html/pages/graphs.inc.php | 14 ++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/html/includes/print-graphrow.inc.php b/html/includes/print-graphrow.inc.php index e1d52bb93..ab54dd6c5 100644 --- a/html/includes/print-graphrow.inc.php +++ b/html/includes/print-graphrow.inc.php @@ -39,8 +39,9 @@ else { if($_SESSION['screen_width']) { if($_SESSION['screen_width'] >= 800) { - $graph_array['width'] = ($_SESSION['screen_width'] - 400 )/count($periods)+1; - }else { + $graph_array['width'] = ($_SESSION['screen_width'] - 420 )/count($periods)+1; + } + else { $graph_array['width'] = $_SESSION['screen_width'] - 155; } } diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index bcb1c9243..075fd5968 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -112,21 +112,11 @@ else { $graph_array['width'] = $graph_width; if($_SESSION['screen_width']) { - if($_SESSION['screen_width'] > 800) { - $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/10)); - } - else { - $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/4)); - } + $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/12)); } if($_SESSION['screen_height']) { - if($_SESSION['screen_height'] > 960 ) { - $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2)); - } - else { - $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/1.5)); - } + $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2)); } echo("
");