Beispiel #1
0
        }
    }
}
// change format of x-labels
for ($i = 0; $i < sizeof($x_axis); $i++) {
    $x_axis[$i] = date('M jS', strtotime($x_axis[$i]));
}
$graph = new Graph(800, 500);
$graph->img->SetMargin(40, 40, 40, 40);
$graph->img->SetAntiAliasing();
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set("{$category} for {$username}");
$graph->xaxis->title->Set('Date');
//$graph->yaxis->title->Set('$category');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTickLabels($x_axis);
// Use 20% "grace" to get slightly larger scale then min/max of
// data
$graph->yscale->SetGrace(0);
//$graph->x_axis->SetScale()
$p1 = new BarPlot($y_axis);
//$p1->mark->SetType(MARK_FILLEDCIRCLE);
//$p1->mark->SetFillColor("red");
//$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$graph->Add($p1);
$graph->Stroke();