ChartDirector allows a XY chart to containing multiple layers of the same or different types. In this example, all layers are 3D area layers. The areas are filled using semi-transparent colors to avoid the area on the front hiding the areas at the back.
[File: phpdemo/deptharea.php".]
setPlotArea(50, 30, 250, 150);
#Add a legend box at (55, 0) (top of the chart) using 8 pts Arial Font. Set
#background and border to Transparent.
$legendObj = $c->addLegend(55, 0, false, "", 8);
$legendObj->setBackground(Transparent);
#Add a title to the x axis
$c->xAxis->setTitle("Network Load for Jun 12");
#Add a title to the y axis
$c->yAxis->setTitle("MBytes");
#Set the labels on the x axis
$c->xAxis->setLabels($labels);
#Add three area layers, each representing one data set. The areas are drawn in
#semi-transparent colors.
$c->addAreaLayer($data2, 0x808080ff, "Server #1", 3);
$c->addAreaLayer($data0, 0x80ff0000, "Server #2", 3);
$c->addAreaLayer($data1, 0x8000ff00, "Server #3", 3);
#output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
?> |
© 2004 Advanced Software Engineering Limited. All rights reserved.