Home  >  Article  >  Backend Development  >  jpgraph图表使用引出类 就无法输出图表

jpgraph图表使用引出类 就无法输出图表

WBOY
WBOYOriginal
2016-06-13 11:58:03962browse

jpgraph图表使用引入类 就无法输出图表

本帖最后由 h9zhou 于 2014-05-12 15:31:35 编辑 jpgraph图表使用问题,在显示图表的php文件一引入类  ,就无法输出图表,图表就变成一个叉,是jpgraph不支持吗

在问个问题 jpgraph 这东西要不要学,实际用的多吗?

<?php // content="text/plain; charset=utf-8"<br />require_once ('SqlHelper.class.php');//这是我写的类,用于操作数据库,但是一引入就出错<br />require_once ('jpgraph/jpgraph.php');<br />require_once ('jpgraph/jpgraph_bar.php');<br /><br /><br />$datay1=array(12,12,15);<br />$datay2=array(0,0,0);<br /><br />// Create the graph.<br />$graph = new Graph(350,250);<br />$graph->SetScale('textlin');<br />$graph->SetMarginColor('silver');<br /><br /><br />// Setup title<br />$str="";<br />$id=$_REQUEST['id'];<br />if($id==1){<br />	$str="支持布什的情况统计图";<br />}else if($id==2) {<br />	$str="支持奥巴马的情况统计图";<br />}<br />$graph->title->Set($str);<br />$graph->title->setFont(FF_SIMSUN,FS_BOLD,14);<br />// Create the first bar<br />$bplot = new BarPlot($datay1);<br />$bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);<br />$bplot->SetColor('darkred');<br /><br />// Create the second bar<br />$bplot2 = new BarPlot($datay2);<br />$bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);<br />$bplot2->SetColor('darkgreen');<br /><br />// And join them in an accumulated bar<br />$accbplot = new AccBarPlot(array($bplot,$bplot2));<br />$graph->Add($accbplot);<br /><br />$graph->Stroke();<br />?><br />

------解决方案--------------------
去掉所有相关文件的 BOM 头 和 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn