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.
Graph controls in windows and user objects, and graphs in DataWindow controls
controlname.SetDataPieExplode ( { graphcontrol, } seriesnumber, datapoint, percentage )
Argument |
Description |
---|---|
controlname |
The name of the graph in which you want to explode a pie slice, or the name of the DataWindow containing the graph. |
graphcontrol (DataWindow control only) (optional) |
A string whose value is the name of the graph in the DataWindow control in which you want to explode a pie slice. |
seriesnumber |
The number that identifies the series. |
datapoint |
The number of the data point (that is, the pie slice) to be exploded. |
percentage |
A number between 0 and 100 which is the percentage of the radius that the pie slice is moved away from the center. When percentage is 100, the tip of the slice is even with the circumference of the pie’s circle. |
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is null, SetDataPieExplode returns null.
If the graph is not a pie graph, the function has no effect.
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:
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