Commit 31426271 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add padding to top of plot area


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 96c07456
......@@ -679,6 +679,7 @@ function graph_site_data_weekly() {
'group-count' => array('color' => 'blue@0.4', 'name' => get_string('groups')),
);
$yaxis = array('min' => array(), 'max' => array());
foreach (array_keys($datasetinfo) as $k) {
$dataset =& Image_Graph::factory('dataset', array($dataarray[$k]));
$dataset->setName($datasetinfo[$k]['name']);
......@@ -686,8 +687,18 @@ function graph_site_data_weekly() {
$linestyle =& Image_Graph::factory('Image_Graph_Line_Solid', array($datasetinfo[$k]['color']));
$linestyle->setThickness(3);
$plot->setLineStyle($linestyle);
$yaxis['max'][$k] = max($dataarray[$k]);
$yaxis['min'][$k] = min($dataarray[$k]);
}
$Axis =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
$maxy = max($yaxis['max']);
$Axis->forceMaximum($maxy * 1.025);
// $miny = min($yaxis['min']);
// $padding = ($maxy - $miny) * 0.025;
// $Axis->forceMaximum($maxy + $padding);
// $Axis->forceMinimum($miny - $padding);
$Graph->done(array('filename' => get_config('dataroot') . 'weekly.png'));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment