pChart库的使用请问

WBOY
Release: 2016-06-13 12:58:12
Original
963 people have browsed it

pChart库的使用请教

<?php<br />
 include("pChart/pData.class"); //数据类<br />
 include("pChart/pChart.class"); //画图类<br />
 <br />
//准备好画图的数据<br />
$arr1 = array(1225.48,627.65); // 对应数据<br />
$arr2 = iconv_arr(array('直营','加盟',)); //数据的文字,和数据位置对应,这里也用了iconv_arr转换中文<br />
 <br />
//第一步 获得饼图数据<br />
$data = new pdata;     <br />
$data->AddPoint($arr1,"serie1"); //装入数据并命名为serie1<br />
$data->AddPoint($arr2,"serie2"); //装入说明并命名为serie2<br />
$data->AddAllSeries();          //提交数据<br />
$data->SetAbsciseLabelSerie("serie2");   //设置标签
Copy after login



为什么我把 $arr1 $arr2直接等于一个SQL查询出来的数组就有问题了呢?数据提交就好像直接到了最后一条。

while($row1=mssql_fetch_assoc($result1)){;<br />
     	//准备好画图的数据     	<br />
$arr1 = round($row1['XX1']); // 对应数据<br />
$arr2 = iconv_arr($row1['XX2']); //数据的文字,和数据位置对应,这里也用了iconv_arr转换中文<br />
//第一步 获得饼图数据<br />
$data = new pdata;     <br />
$data->AddPoint($arr1,"serie1"); //装入数据并命名为serie1<br />
$data->AddPoint($arr2,"serie2"); //装入说明并命名为serie2<br />
$data->AddAllSeries();          //提交数据<br />
$data->SetAbsciseLabelSerie("serie2");   //设置标签<br />
echo $arr1;<br />
//echo $arr2."<br />";
Copy after login



结果就会是一条信息.饼也是100%。。 不知道为什么数据提交的不对。
------解决方案--------------------
你的echo有没有把所有需要的数据echo出来?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template