setRoundedFrame(); # Set the plotarea at (55, 60) and of size 520 x 200 pixels, with white (ffffff) # background. Set horizontal and vertical grid lines to grey (cccccc). $c->setPlotArea(50, 60, 525, 200, 0xffffff, -1, -1, 0xcccccc, 0xcccccc); # Add a legend box at (55, 32) (top of the chart) with horizontal layout. Use 9 pts # Arial Bold font. Set the background and border color to Transparent. $legendObj = $c->addLegend(55, 32, false, "arialbd.ttf", 9); $legendObj->setBackground(Transparent); # Add a title box to the chart using 15 pts Times Bold Italic font. The text is white # (ffffff) on a deep blue (000088) background, with soft lighting effect from the # right side. $textBoxObj = $c->addTitle("Long Term Interest Rates", "timesbi.ttf", 15, 0xffffff); $textBoxObj->setBackground(0x000088, -1, softLighting(Right)); # Set the y axis label format to display a percentage sign $c->yAxis->setLabelFormat("{value}%"); # Add a red (ff0000) step line layer to the chart and set the line width to 2 pixels $layer0 = $c->addStepLineLayer($dataY0, 0xff0000, "Country AAA"); $layer0->setXData($dataX0); $layer0->setLineWidth(2); # Add a blue (0000ff) step line layer to the chart and set the line width to 2 pixels $layer1 = $c->addStepLineLayer($dataY1, 0x0000ff, "Country BBB"); $layer1->setXData($dataX1); $layer1->setLineWidth(2); # output the chart header("Content-type: image/png"); print($c->makeChart2(PNG)); ?>