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.
PowerBuilder DataWindow DataWindow control
DataWindow Web ActiveX DataWindow control
integer dwcontrol.SetDataPieExplode ( string graphcontrol, integer seriesnumber, integer datapoint, integer percentage )
number dwcontrol.SetDataPieExplode ( string graphcontrol, number seriesnumber, number datapoint, number percentage )
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control containing the graph. |
graphcontrol |
A string whose value is the name of the graph in the DataWindow control. |
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 that 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. |
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, SetDataPieExplode has no effect.
PowerBuilder 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 the DataWindow control:
integer series, datapoint
grObjectType clickedtype
integer percentage
percentage = 50
IF (This.GraphType <> PieGraph! AND &
This.GraphType <> Pie3D!) THEN RETURN
clickedtype = This.ObjectAtPointer( "gr_equipment", &
series, datapoint)
IF (series > 0 and datapoint > 0) THEN
This.SetDataPieExplode("gr_equipment", series, &
datapoint, percentage)
END IF