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

WBOY
Libérer: 2016-06-13 11:58:03
original
945 Les gens l'ont consulté

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 />
Copier après la connexion

------解决方案--------------------
去掉所有相关文件的 BOM 头 和 
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!