hloc.php
Back to Chart Graphics
setPlotArea(50, 25, 500, 250)->setGridColor(0xc0c0c0, 0xc0c0c0);
# Add a title to the chart
$c->addTitle("Universal Stock Index on Jan 2001");
# Add a custom text at (50, 25) (the upper left corner of the plotarea). Use 12pt Arial Bold/blue
# (4040c0) as the font.
$c->addText(50, 25, "(c) Global XYZ ABC Company", "Arial Bold", 12, 0x4040c0);
# Add a title to the x axis
$c->xAxis->setTitle("Jan 2001");
# Set the labels on the x axis. Rotate the labels by 45 degrees.
$c->xAxis->setLabels($labels)->setFontAngle(45);
# Add a title to the y axis
$c->yAxis->setTitle("Universal Stock Index");
# Draw the y axis on the right hand side of the plot area
$c->setYAxisOnRight(true);
# Add a HLOC layer to the chart using green (008000) for up days and red (ff0000) for down days
$layer = $c->addHLOCLayer3($highData, $lowData, $openData, $closeData, 0x008000, 0xff0000);
# Set the line width to 2 pixels
$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} Jan 2001\nHigh:{high}\nOpen:{open}\nClose:{close}\nLow:{low}'"));
?>
Simple HLOC Chart
Simple HLOC Chart
renderHTML(); ?>