he aqui el codigo que estoy utilizando
Código PHP:
<?php
include("conex.php");
include("../jpgraph/src/jpgraph.php");
include("../jpgraph/src/jpgraph_pie.php");
include("../jpgraph/src/jpgraph_pie3d.php");
$query = mysql_query("SELECT count(id_unidades) as id_unidades, nombre FROM unidades");
$data[]=array();
$can[]=array();
while ($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
$data[] = $row['id_unidades'];
$can[] = $row['nombre'];
echo $row['id_unidades'];
}
$graph = new PieGraph(550,300,"auto");
$graph->img->SetAntiAliasing();
$graph->SetMarginColor('gray');
//$graph->SetShadow();
// Setup margin and titles
$graph->title->Set("Candidatos y Votos");
$p1 = new PiePlot3D($data);
$p1->SetSize(0.45);
$p1->SetCenter(0.4);
// Setup slice labels and move them into the plot
$p1->value->SetFont(FF_FONT1,FS_BOLD);
$p1->value->SetColor("black");
$p1->SetLabelPos(0.5);
$p1->SetLegends($can);
$p1->ExplodeAll();
$graph->Add($p1);
$graph->Stroke();
?>
agradecería quien me pudiera echar una mano saludos