PHPGraphLibPie is an extension of the original PHPGraphLib that allows you to make pie charts using the existing PHPGraphLib framework. For an example of setup and usage, see Tutorial #3: PHPGraphLibPie Extension - Creating a Pie Chart.
PHPGraphLibPie inherits many of the same functions as PHPGraphLib. There is a list of inherited functions at the bottom of this page.
Below is the default form of the constructor:
PHPGraphLibPie object constructor. $width and $height arguments are optional. Default width=400, height=300.
If you specify the optional filename argument, PHPGraphLib will not display to the screen, but instead create a .png file in the same directory as the script where PHPGraphLib is being called.
Display % data labels by each section of the pie/ Accepts either true or false arguments. Default value is true, data labels are displayed.
Sets the number of significant digits to be displayed on the graph if the setDataLabels() function is true. Default is 0 significant digits, meaning that hey data labels are whole numbers.
Sets the text color of the display % labels on the pie chart. Color may be specified as one of the supported colors or as an RGB value comma separated string. Default color is a black.
PHPGraphLibPie also inherits some functions from the PHPGraphLib class. These functions are:
As of PHPGraphLib 2.0, PHPGraphLibPie also inherits the following functions that used to be just included in PHPGraphLibPie.
For usage, please refer to the main PHPGraphLib Function Reference.
In addition to supporting all the colors built into PHPGraphLib, PHPGraphLibPie also supports the following colors in name:
The colors used in the pie slices are automatically drawn from a list that includes these colors. Lighter pastel colors, are easier on the eyes when used in a pie chart situation.