Divide the width by the number of graphs in a row reduced by an arbitrary value to allow margins

Only display one graph per line if width is < 800px
This commit is contained in:
Louis Bailleul
2015-11-19 13:58:17 +00:00
parent fc9f7eade8
commit 6116f00e58

View File

@ -39,12 +39,18 @@ else {
if($_SESSION['screen_width']) if($_SESSION['screen_width'])
{ {
$graph_array['width'] = $_SESSION['screen_width']/5.5; if($_SESSION['screen_width'] >= 800)
{
$graph_array['width'] = ($_SESSION['screen_width'] - 400 )/count($periods)+1;
}else
{
$graph_array['width'] = $_SESSION['screen_width'] - 155;
}
} }
if($_SESSION['screen_height']) if($_SESSION['screen_height'])
{ {
$graph_array['height'] = $_SESSION['screen_height']/6; $graph_array['height'] = ($_SESSION['screen_height'] - 250)/4;
} }