For more information about using the pChart library, see <;? Php & nbsp; include ("pChart/pData. class "); & nbsp; // data class & nbsp; include (" pChart/pChart. class "); & nbsp; // drawing class & nbsp; // prepare the drawing data $ arr pChart library for use
Include ("pChart/pData. class"); // data class
Include ("pChart/pChart. class"); // drawing class
// Prepare the drawing data
$ Arr1 = array (1225.48, 627.65); // corresponding data
$ Arr2 = iconv_arr (array ('Camp ', 'Franchise',); // The Data text corresponds to the data location. iconv_arr is also used to convert Chinese characters.
// Obtain pie chart data
$ Data = new pdata;
$ Data-> AddPoint ($ arr1, "serie1"); // load the data and name it serie1
$ Data-> AddPoint ($ arr2, "serie2"); // load description and name it serie2
$ Data-> AddAllSeries (); // submit data
$ Data-> SetAbsciseLabelSerie ("serie2"); // Set the tag
Why is there a problem when I directly equals $ arr1 $ arr2 to an array queried by an SQL statement? The data is submitted directly to the last one.
While ($ row1 = mssql_fetch_assoc ($ result1 )){;
// Prepare the drawing data
$ Arr1 = round ($ row1 ['xx1']); // corresponding data
$ Arr2 = iconv_arr ($ row1 ['xx2 ']); // The Data text corresponds to the data location. iconv_arr is also used to convert Chinese characters.
// Obtain pie chart data
$ Data = new pdata;
$ Data-> AddPoint ($ arr1, "serie1"); // load the data and name it serie1
$ Data-> AddPoint ($ arr2, "serie2"); // load description and name it serie2
$ Data-> AddAllSeries (); // submit data
$ Data-> SetAbsciseLabelSerie ("serie2"); // Set the tag
Echo $ arr1;
// Echo $ arr2 ."
";
The result is a piece of information. the pie is 100% .. I don't know why the data is submitted incorrectly.
------ Solution --------------------
Does your echo all the required data?