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
?>
" /> <br> pie chart using the gPieChart class.
<p>
<em>code:</em><br>
<code>
$piChart = new gPieChar();<br>
$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>
    echo "direccion: " . $json[$i]->direction . "<br />";
    echo "minutos restantes: " . $json[$i]->remainingMinutes . "<br />";
    echo "proxima parada: " . $json[$i]->nextStop . "<br />";
    echo "descripcion proxima parada: " . $json[$i]->nextStopDescription . "<br />";
    echo "destino: " . $json[$i]->destinationStop . "<br />";
    echo "descripcion destino: " . $json[$i]->destinationStopDescription . "<br />";
    echo "orden de parada: " . $json[$i]->orderStop . "<br />";
    echo "<br />";
    */
}
//print_r($json);
echo "<br />";
$pie3dChart = new gPie3DChart();
//for ($i = 0; $i < count($tiempo); $i++)
//$pie3dChart->addDataSet(array($tiempo[$i]));
$pie3dChart->addDataSet($tiempo);
$pie3dChart->setLegend($servicio);
$pie3dChart->setLabels($paradas);
$pie3dChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa", "FFC0CB", "FFA07A", "00FFFF", "FFDEAD", "DCDCDC"));
/*
$barChart = new gBarChart(500,150,'g');
//for ($i = 0; $i < count($tiempo); $i++)
	//$barChart->addDataSet(array($tiempo[$i]));

$barChart->addDataSet($tiempo);
$barChart->addAxisRange(1, 0, $tiempoMax);
$barChart->addAxisLabel(0, $paradas);

$barChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa", "FFC0CB", "FFA07A", "00FFFF", "FFDEAD", "DCDCDC"));
$barChart->setVisibleAxes(array('x','y'));
$barChart->setLegend($paradas);