Login Register Wishes Forum About
Language Reference » Pie charts class » Pie basics
Help topics
Latest updates
4669d  replaceImageMapTitle
4669d  replaceImageMapValues
4669d  createFunctionSerie
4669d  setAbsicssaPosition
4669d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
Pie charts basics

pChart can render both 2D and 3D pie charts. Data are provided through the pData class with some limitation because only one data serie may be rendered on this kind of charts.

Only the 1st data serie that is marked as Drawable will be used.
An abscissa serie must be set, it will be used for labelling the data.


Let‘s assume that we got the data represented in the table bellow :

This will lead to the following declaration with the pData object structure :
 /* pData object creation */
 $MyData = new pData();   

 /* Data definition */

 /* Labels definition */

Full example code

 /* pChart library inclusions */

 /* pData object creation */
 $MyData = new pData();   
 /* Data definition */
 /* Labels definition */

 /* Create the pChart object */
 $myPicture = new pImage(300,150,$MyData);

 /* Draw a gradient background */

 /* Add a border to the picture */

 /* Create the pPie object */ 
 $PieChart = new pPie($myPicture,$MyData);

 /* Enable shadow computing */ 

 /* Set the default font properties */ 

 /* Draw a splitted pie chart */ 

 /* Render the picture (choose the best way) */
Last updated on 12/07/2010 
by Jean-Damien 
Linked resources
  There is no linked topic yet.
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.