multiline.php
Back to Chart Graphics
setRoundedFrame();
# Set the plotarea at (55, 58) and of size 520 x 195 pixels, with white background. Turn on both
# horizontal and vertical grid lines with light grey color (0xcccccc)
$c->setPlotArea(55, 58, 520, 195, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);
# Add a legend box at (50, 30) (top of the chart) with horizontal layout. Use 9pt Arial Bold font.
# Set the background and border color to Transparent.
$c->addLegend(50, 30, false, "Arial Bold", 9)->setBackground(Transparent);
# Add a title box to the chart using 15pt Times Bold Italic font, on a light blue (CCCCFF)
# background with glass effect. white (0xffffff) on a dark red (0x800000) background, with a 1 pixel
# 3D border.
$c->addTitle("Application Server Throughput", "Times New Roman Bold Italic", 15)->setBackground(
0xccccff, 0x000000, glassEffect());
# Add a title to the y axis
$c->yAxis->setTitle("MBytes per hour");
# Set the labels on the x axis.
$c->xAxis->setLabels($labels);
# Display 1 out of 3 labels on the x-axis.
$c->xAxis->setLabelStep(3);
# Add a title to the x axis
$c->xAxis->setTitle("Jun 12, 2006");
# Add a line layer to the chart
$layer = $c->addLineLayer2();
# Set the default line width to 2 pixels
$layer->setLineWidth(2);
# Add the three data sets to the line layer. For demo purpose, we use a dash line color for the last
# line
$layer->addDataSet($data0, 0xff0000, "Server #1");
$layer->addDataSet($data1, 0x008800, "Server #2");
$layer->addDataSet($data2, $c->dashLineColor(0x3333ff, DashLine), "Server #3");
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "",
"title='[{dataSetName}] Hour {xLabel}: {value} MBytes'"));
?>
Multi-Line Chart (1)
Multi-Line Chart (1)
renderHTML(); ?>