stepline.php
Back to Chart Graphics
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 9pt Arial Bold font.
# Set the background and border color to Transparent.
$c->addLegend(55, 32, false, "Arial Bold", 9)->setBackground(Transparent);
# Add a title box to the chart using 15pt Times Bold Italic font. The text is white (ffffff) on a
# deep blue (000088) background, with soft lighting effect from the right side.
$c->addTitle("Long Term Interest Rates", "Times New Roman Bold Italic", 15, 0xffffff
)->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
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "",
"title='{dataSetName} change to {value}% on {x|mmm dd, yyyy}'"));
?>
Step Line Chart
Step Line Chart
renderHTML(); ?>