By default the value (if enabled through the $pie->label->show() ) close to each slice will have a label corresponding to the percentage of that slice.
Each plot may have an arbitrary title which can be accessed through the ?title? property in the PiePlot class. The title will be automatically centred on top of the PiePlot clear of any possible labels. To set the title use the Set() method , i.e. $plot->title->Set(?MyTitle?).
To format the slice labels use the SetFormat() method of the value class.
Explode one or more slices as specified radius.
Argument | Default | Description |
---|---|---|
$aExplodeArr | Explode specification |
If you only want to explode a single slice you could also use the ExplodeSlice() method.
Example:
Explode all slices a specified amount
Argument | Default | Description |
---|---|---|
$radius | 20 | Explode radius |
Example:
Explode a single slice a specified radius
Argument | Default | Description |
---|---|---|
$e | Which slice to explode | |
$radius | 20 | Radius to explode to |
Example:
//---------------// PUBLIC METHODS
Argument | Default | Description |
---|---|---|
$x | X-position as fraction of width | |
$y | 0.5 | Y-position as fraction of height |
Example:
Specify frame color for pie.
Argument | Default | Description |
---|---|---|
$aColor | Color. |
Example:
Specify URL targets for image maps
Argument | Default | Description |
---|---|---|
$aTargets | No description available | |
$aAlts | '' | No description available |
$aWinTargets | '' | No description available |
Each slice will aslo have it's own 'alt' tag. Depending on the browser this tag is usually showed when the mouse is hold over a poarticular area on the image map. When formatting the alt strings can be specified as a printf() format string. The value supplied to the string will be the value for each slice.
Example:
Enable guideline and set drawing policy
Argument | Default | Description |
---|---|---|
$aFlg | true | TRUE=Enable guide lines |
$aCurved | true | Curve the labels around the pie |
$aAlways | false | Always use a guide line to the label |
Example:
Adjuste the distance between labels and labels and pie
Argument | Default | Description |
---|---|---|
$aVFactor | Vertical fraction | |
$aRFactor | 0.8 | Radius factor |
Example:
Adjust the positoin of slice labels
Argument | Default | Description |
---|---|---|
$aLblPosAdj | Position as fraction of radius |
Note: The adjustment affect both manually speicfied labels with SetLabels() as well as automtic labels.
Example:
Specify individual text labels for all slices
Argument | Default | Description |
---|---|---|
$aLabels | Arrays of strings | |
$aLblPosAdj | "auto" | Position as fraction of the radius |
"May %.1f%%"
would display the in the pie "May 28.3%" assuming you had choosen to use percentage values (SetLabelType())
The second parameter specifies where to position these labels. The position is specified as a fraction of the radius of the pie plot or as the special strine 'auto'. If you specify this string value JpGraph will automtically determine the best position for the labels inside the pie. This is the default if you don't explicitely specify the position.
If you specify a value > 1.0 then the labels will just be move further out. For example if you specify the position as 1.5 then the labels will move out a further 50% of the current pie radius.
Note: The actual alignment of the labels are dependent on the position. If the labels are just outside the pie they will be individually positioned according to the angle. If the labels are positioned inside the pie then the point of gravity within the text will be aligned with the specified position in the pie.
Example:
Should we display actual value or percentage?
Argument | Default | Description |
---|---|---|
$aType | No description available |
The following values are allowed arguments:
Example:
// Set label arrays
Argument | Default | Description |
---|---|---|
$aLegend | Array of strings |
Each text string can be formatted as a printf() format string since when printed they will be passed the value for that slice.
Tip: If you have many evry small slices then the labels close to the pie may be overwriting each other. In this case it is probably better to hide the labels by the slices and instead just show the values ion the legends.
Example:
Add a drop shadow to the pie slices
Argument | Default | Description |
---|---|---|
$aColor | 'darkgray' | Shadow color |
$aDropWidth | 4 | Drop distance for shadow |
This is often more affective if one or more slices are exploded.
Example:
// Size in percentage
Argument | Default | Description |
---|---|---|
$aSize | Size of radius |
If the value is >1 then it is interpretated as an absolute size in pixels.
Example:
Override theme coplros for slices
Argument | Default | Description |
---|---|---|
$aColors | Array of colors |
If you supply fewer colors than pie-slices than the colors will be re-used from the beginning of the array.
Example:
Speciy start angel for first slice
Argument | Default | Description |
---|---|---|
$aStart | Start angle in degrees |
The angle should be specified in degrees.
Example:
//Add the last point on the arc
Argument | Default | Description |
---|---|---|
$aTheme | Theme name |
Example:
DEPRECATED: See SetLabelType()
Argument | Default | Description |
---|---|---|
$aType | Value type |
Example:
// Should the circle around a pie plot be displayed
Argument | Default | Description |
---|---|---|
$exterior | true | Display circle on the outer edge of pieplot |
$interior | true | Display the lines between each slice |
Example:
Constructor for PiePlots
Argument | Default | Description |
---|---|---|
$data | Data array for Pie |
Example: