patternarea.php
Back to Chart Graphics
setPlotArea(45, 35, 240, 120, 0xffffff, -1, -1, $c->dashLineColor(0x000000, 0x000103),
$c->dashLineColor(0x000000, 0x000103));
# Add a title to the chart using 10pt Arial Bold font. Use a 1 x 2 bitmap pattern as the background.
# Set the border to black (0x0).
$c->addTitle("Snow Percipitation (Dec 12)", "Arial Bold", 10)->setBackground($c->patternColor(array(
0xb0b0f0, 0xe0e0ff), 2), 0x000000);
# Add a title to the y axis
$c->yAxis->setTitle("mm 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 an area layer to the chart
$layer = $c->addAreaLayer();
# Load a snow pattern from an external file "snow.png".
$snowPattern = $c->patternColor2(dirname(__FILE__)."/snow.png");
# Add a data set to the area layer using the snow pattern as the fill color. Use deep blue
# (0x0000ff) as the area border line color (&H0000ff&)
$layer->addDataSet($data)->setDataColor($snowPattern, 0x0000ff);
# Set the line width to 2 pixels to highlight the line
$layer->setLineWidth(2);
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "", "title='{xLabel}:00 - {value} mm/hour'"));
?>
Pattern Area Chart
Pattern Area Chart
renderHTML(); ?>