PChart library usage

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.