Make graph page use session variable to compute graph size

This commit is contained in:
Louis Bailleul
2015-11-20 14:39:19 +00:00
parent ce8e79c63a
commit 961a9fff4b
2 changed files with 5 additions and 14 deletions

View File

@@ -39,8 +39,9 @@ else {
if($_SESSION['screen_width']) { if($_SESSION['screen_width']) {
if($_SESSION['screen_width'] >= 800) { if($_SESSION['screen_width'] >= 800) {
$graph_array['width'] = ($_SESSION['screen_width'] - 400 )/count($periods)+1; $graph_array['width'] = ($_SESSION['screen_width'] - 420 )/count($periods)+1;
}else { }
else {
$graph_array['width'] = $_SESSION['screen_width'] - 155; $graph_array['width'] = $_SESSION['screen_width'] - 155;
} }
} }

View File

@@ -112,21 +112,11 @@ else {
$graph_array['width'] = $graph_width; $graph_array['width'] = $graph_width;
if($_SESSION['screen_width']) { if($_SESSION['screen_width']) {
if($_SESSION['screen_width'] > 800) { $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/12));
$graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/10));
}
else {
$graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/4));
}
} }
if($_SESSION['screen_height']) { if($_SESSION['screen_height']) {
if($_SESSION['screen_height'] > 960 ) { $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2));
$graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2));
}
else {
$graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/1.5));
}
} }
echo("<hr />"); echo("<hr />");