コード例 #1
0
    function test_ConcentricPieChart()
    {
        $CPChart = new gConcentricPieChart();
        $CPChart->addDataSet(array(112, 315, 66, 40));
        $CPChart->addDataSet(array(100, 235, 346, 50));
        $CPChart->addColors(array("008800", "880000"));
        $CPChart->addColors(array("000088", "888800"));
        $CPChart->addLegend(array('1', '2', '3', '4'));
        $CPChart->addLegend(array('1a', '2a', '3a', '4a'));
        $text = <<<END
newConcentricPieChart:
addDataSet: 112,315,66,40
addDataSet: 100,235,346,50
addColors: 008800, 880000
addColors: 000088, 888800
addLegend: 1, 2, 3, 4
addLegend: 1a, 2a, 3a, 4a
END;
        $parser = new gChartPhpDSLParser();
        $parser->parse($text);
        $this->assertEqual($CPChart->getUrl(), $parser->getUrl());
    }
コード例 #2
0
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();
$CPChart->addDataSet(array(112, 315, 66, 40));
$CPChart->addDataSet(array(100, 235, 346, 50));
$CPChart->addColors(array("008800", "880000"));
$CPChart->addColors(array("000088", "888800"));
$CPChart->addLegend(array('1', '2', '3', '4'));
$CPChart->addLegend(array('1a', '2a', '3a', '4a'));
?>
<img src="<?php 
print $CPChart->getUrl();
?>
" /> <br> pie chart using the gPieChart class.
<p>
<em>code:</em><br>
<code>
$CPChart = new gConcentricPieChart();<br>