simpletreemap.php
Back to Chart Graphics
setPlotArea(10, 10, 380, 380);
# Obtain the root of the tree map, which is the entire plot area
$root = $c->getRootNode();
# Add first level nodes to the root.
$root->setData($data, $labels, $colors);
# Get the prototype (template) for the first level nodes.
$nodeConfig = $c->getLevelPrototype(1);
# Set the label format for the nodes to show the label and value with 8pt Arial Bold font in black
# color (000000) and center aligned in the node.
$nodeConfig->setLabelFormat("{label}<*br*>{value}", "Arial Bold", 8, 0x000000, Center);
# Set the node fill color to the provided color and the border color to white (ffffff)
$nodeConfig->setColors(-1, 0xffffff);
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "", "title='<*cdml*>{label}: {value}'"));
?>
Simple Tree Map Charts
Simple Tree Map Charts
renderHTML(); ?>