Example #1
0
//bar2
$data2y = array(180, 200, 220, 190, 170, 195, 190, 210, 200, 205, 195, 150);
//bar3
$data3y = array(220, 230, 210, 175, 185, 195, 200, 230, 200, 195, 180, 130);
$data4y = array(40, 45, 70, 80, 50, 75, 70, 70, 80, 75, 80, 50);
$data5y = array(20, 20, 25, 22, 30, 25, 35, 30, 27, 25, 25, 45);
//line1
$data6y = array(50, 58, 60, 58, 53, 58, 57, 60, 58, 58, 57, 50);
foreach ($data6y as &$y) {
    $y -= 10;
}
// Create the graph. These two calls are always required
$graph = new Graph\Graph(750, 320, 'auto');
$graph->SetScale("textlin");
$graph->SetY2Scale("lin", 0, 90);
$graph->SetY2OrderBack(false);
$graph->SetMargin(35, 50, 20, 5);
$theme_class = new UniversalTheme();
$graph->SetTheme($theme_class);
$graph->yaxis->SetTickPositions(array(0, 50, 100, 150, 200, 250, 300, 350), array(25, 75, 125, 175, 275, 325));
$graph->y2axis->SetTickPositions(array(30, 40, 50, 60, 70, 80, 90));
$months = $gDateLocale->GetShortMonth();
$months = array_merge(array_slice($months, 3, 9), array_slice($months, 0, 3));
$graph->SetBox(false);
$graph->ygrid->SetFill(false);
$graph->xaxis->SetTickLabels(array('A', 'B', 'C', 'D'));
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false, false);
// Setup month as labels on the X-axis
$graph->xaxis->SetTickLabels($months);
// Create the bar plots