setPlotArea(60, 50, 480, 270, $c->linearGradientColor(60, 50, 60, 270, 0xeeeeff, 0x0000cc), -1, 0xffffff, 0xffffff); # Add a title to the chart using 15pts Times Bold Italic font $c->addTitle("Global Revenue for Year $selectedYear", "timesbi.ttf", 18); # Add a legend box at (60, 25) (top of the plotarea) with 9pts Arial Bold font $legendObj = $c->addLegend(60, 25, false, "arialbd.ttf", 9); $legendObj->setBackground(Transparent); # Add a line chart layer using the supplied data $layer = $c->addLineLayer2(); $dataSetObj = $layer->addDataSet($software, 0xffaa00, "Software"); $dataSetObj->setDataSymbol(CircleShape, 9); $dataSetObj = $layer->addDataSet($hardware, 0x00ff00, "Hardware"); $dataSetObj->setDataSymbol(DiamondShape, 11); $dataSetObj = $layer->addDataSet($services, 0xff0000, "Services"); $dataSetObj->setDataSymbol(Cross2Shape(), 11); # Set the line width to 3 pixels $layer->setLineWidth(3); # Set the x axis labels. In this example, the labels must be Jan - Dec. $labels = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"); $c->xAxis->setLabels($labels); # Set y-axis tick density to 30 pixels. ChartDirector auto-scaling will use this as # the guideline when putting ticks on the y-axis. $c->yAxis->setTickDensity(30); # Synchronize the left and right y-axes $c->syncYAxis(); # Set the y axes titles with 10pts Arial Bold font $c->yAxis->setTitle("USD (Millions)", "arialbd.ttf", 10); $c->yAxis2->setTitle("USD (Millions)", "arialbd.ttf", 10); # Set all axes to transparent $c->xAxis->setColors(Transparent); $c->yAxis->setColors(Transparent); $c->yAxis2->setColors(Transparent); # Set the label styles of all axes to 8pt Arial Bold font $c->xAxis->setLabelStyle("arialbd.ttf", 8); $c->yAxis->setLabelStyle("arialbd.ttf", 8); $c->yAxis2->setLabelStyle("arialbd.ttf", 8); # Create the image and save it in a temporary location $chart1URL = $c->makeSession("chart1"); # Create an image map for the chart $imageMap = $c->getHTMLImageMap("xystub.php", "", "title='{dataSetName} @ {xLabel} = USD {value|0}M'"); ?>