SetDataPieExplode
PowerScript function
Description
Explodes a pie slice in a pie graph. The exploded slice is moved
away from the center of the pie, which draws attention to the data. You
can explode any number of slices of the pie.
Applies to
Graph controls in windows and user objects, and graphs in DataWindow
controls
Syntax
|
1 |
controlname.SetDataPieExplode ( { graphcontrol, } seriesnumber, datapoint, percentage ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want to explode a pie |
|
graphcontrol (DataWindow control only) (optional) |
A string whose value is the name of the graph in the |
|
seriesnumber |
The number that identifies the series. |
|
datapoint |
The number of the data point (that is, the pie slice) to |
|
percentage |
A number between 0 and 100 which is the percentage of the |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, SetDataPieExplode returns null.
Usage
If the graph is not a pie graph, the function has no effect.
Examples
This example explodes the pie slice under the pointer to 50% when
the user double-clicks within the graph. The code checks the property
GraphType to make sure the graph is a pie graph. It then finds out whether
the user clicked on a pie slice by checking the series and data point
values set by ObjectAtPointer. The script is for the DoubleClicked event
of a graph object:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
integer series, datapoint grObjectType clickedtype integer percentage percentage = 50 IF (This.GraphType <> PieGraph! AND & This.GraphType <> Pie3D!) THEN RETURN clickedtype = This.ObjectAtPointer( & series, datapoint) IF (series > 0 and datapoint > 0) THEN This.SetDataPieExplode(series, datapoint, & percentage) END IF |
See also