Example #1
0
$graph->title->Set($cities[$station]["name"] . " [{$station}] Precipitation for " . date("M Y", $ts));
if ($hasclimate) {
    $graph->subtitle->Set("Climate Site: " . $cities[strtoupper($climate_site)]["name"] . "[" . $climate_site . "]");
}
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.05, 0.1, "right", "top");
if ($hasclimate && sizeof($cdiff) > 0) {
    // Create the linear plot
    $b1plot = new BarPlot($cdiff);
    $b1plot->SetFillColor("red");
    $b1plot->SetLegend("Accum Difference");
    $b2plot = new BarPlot($obs);
    $b2plot->SetFillColor("blue");
    $b2plot->SetLegend("Obs Rain");
    $g = new GroupBarPlot(array($b1plot, $b2plot));
    $g->SetAlign("left");
}
// Create the linear plot
$lp1 = new LinePlot($aobs);
$lp1->SetLegend("Actual Accum");
$lp1->SetColor("blue");
$lp1->SetWeight(2);
if ($hasclimate && sizeof($cdiff) > 0) {
    $lp2 = new LinePlot($aclimate);
    $lp2->SetLegend("Climate Accum");
    $lp2->SetColor("red");
    $lp2->SetWeight(2);
    $z = new LinePlot($zeros);
    $z->SetWeight(2);
}
// Add the plot to the graph