Exemplo n.º 1
0
    function test_3DPieChart()
    {
        $pie3dChart = new gPie3DChart();
        $pie3dChart->addDataSet(array(112, 315, 66, 40));
        $pie3dChart->setLegend(array("first", "second", "third", "fourth"));
        $pie3dChart->setLabels(array("first", "second", "third", "fourth"));
        $pie3dChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));
        $text = <<<END
newPie3DChart:
addDataSet: 112,315,66,40
setLegend: first, second, third, fourth
setLabels: first, second, third, fourth
setColors: ff3344, 11ff11, 22aacc, 3333aa
END;
        $parser = new gChartPhpDSLParser();
        $parser->parse($text);
        $this->assertEqual($pie3dChart->getUrl(), $parser->getUrl());
    }
Exemplo n.º 2
0
$piChart->addDataSet(array(112,315,66,40));<br>
$piChart->setLegend(array("first", "second", "third","fourth"));<br>
$piChart->setLabels(array("first", "second", "third","fourth"));<br>
$piChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));<br>
</code>
</p>
<h2>3D Pie Chart</h2>
<?php 
$pie3dChart = new gPie3DChart();
$pie3dChart->addDataSet(array(112, 315, 66, 40));
$pie3dChart->setLegend(array("first", "second", "third", "fourth"));
$pie3dChart->setLabels(array("first", "second", "third", "fourth"));
$pie3dChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));
?>
<img src="<?php 
print $pie3dChart->getUrl();
?>
" /> <br> 3D pie chart using the gPieChart class.
<p>
<em>code:</em><br>
<code>
$pie3dChart = new gPie3DChart();<br>
$pie3dChart->addDataSet(array(112,315,66,40));<br>
$pie3dChart->setLegend(array("first", "second", "third","fourth"));<br>
$pie3dChart->setLabels(array("first", "second", "third","fourth"));<br>
$pie3dChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));<br>
</code>
</p>
<h2>Concentric Pie Chart</h2>
<?php 
$CPChart = new gConcentricPieChart();