setPlotArea(50, 30, 240, 140); $plotAreaObj->setBackground(0xffffff); # Add a legend box at (50, 185) (below of plot area) using horizontal layout. Use 8 # pts Arial font with Transparent background. $legendObj = $c->addLegend(50, 185, false, "", 8); $legendObj->setBackground(Transparent); # Add a title box to the chart using 8 pts Arial Bold font, with yellow (0xffff40) # background and a black border (0x0) $textBoxObj = $c->addTitle("Sales Volume", "arialbd.ttf", 8); $textBoxObj->setBackground(0xffff40, 0); # Set the y axis label format to US$nnnn $c->yAxis->setLabelFormat("US\${value}"); # Set the labels on the x axis. $c->xAxis->setLabels($labels); # Display 1 out of 2 labels on the x-axis. Show minor ticks for remaining labels. $c->xAxis->setLabelStep(2, 1); # Add an stack area layer with three data sets $layer = $c->addAreaLayer2(Stack); $layer->addDataSet($data0, 0x4040ff, "Store #1"); $layer->addDataSet($data1, 0xff4040, "Store #2"); $layer->addDataSet($data2, 0x40ff40, "Store #3"); # output the chart header("Content-type: image/png"); print($c->makeChart2(PNG)); ?>