PieChart

Overview #

A pie chart that is rendered within the browser using SVG or VML. Displays tooltips when hovering over slices.

Example #

<?php
PieChart::create(array(
    "title"=>"Sale Of Category",
    "dataSource"=>$this->dataStore('sale_of_category'),
    "columns"=>array(
        "category",
        "cost"=>array(
            "type"=>"number",
            "prefix"=>"$",
        )
    )
));
?>

3D Pie Chart #

If you set the is3D option to true, your pie chart will be drawn as though it has three dimensions:

<?php
PieChart::create(array(
    ...
    "options"=>array(
        "is3D"=>true
    )
));
?>

Explode Slices #

You can separate pie slices from the rest of the chart with the offset property of the slices option:

<?php
PieChart::create(array(
    ...
    "options"=>array(
        "slices"=>array(
            "3"=>array("offset"=>0.2)
        )
    ),
));
?>

Remove Slices #

To omit a slice, change the color to 'transparent':

<?php
PieChart::create(array(
    ...
    "options"=>array(
        "slices"=>array(
            "3"=>array("color"=>"transparent")
        )
    ),
));
?>

Get started with KoolReport

KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.