<?php include("conn/conn.php");
include_once ("jpgraph/jpgraph.php");
include_once ("jpgraph/jpgraph_pie.php");
include_once ("jpgraph/jpgraph_pie3d.php");			//引用3D饼图PiePlot3D对象所在的类文件
//统计投票的总量
$query=mysql_query("select sum(tb_vote_counts) as vote_gross from tb_vote_more where tb_vote_subject='".$_GET[vote_subject]."'");  
$vote_counts=mysql_result($query,0,"vote_gross");				//获取总的投票数量
if($vote_counts>0){
$querys=mysql_query("select * from tb_vote_more where tb_vote_subject='".$_GET[vote_subject]."' ");
while($myrow=mysql_fetch_array($querys)){
	$vote_content[]=$myrow[tb_vote_content];		
	$resultes[]=$myrow[tb_vote_counts];			//将获取的值写入到数组中
}
$graph = new PieGraph(540,260,'auto');				//创建画布
$graph->SetShadow();								//设置画布阴影
$graph->title->Set("应用3D饼形图统计优秀负责人");			//创建标题
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);			//设置标题字体
$graph->legend->SetFont(FF_SIMSUN,FS_NORMAL);			//设置图例字体
$p1 = new PiePlot3D($resultes);							//创建3D饼形图对象
$p1->SetLegends($vote_content);
$p1->SetCenter(0.4,0.5);					//设置饼形图所在画布的位置
$graph->Add($p1);							//将3D饼图形添加到图像中
$graph->StrokeCSIM();						//输出图像到浏览器
}
?>