SetDataPieExplode method (Graphs in DataWindows)
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.
Controls
PowerBuilder DataWindow DataWindow
control
DataWindow Web ActiveX DataWindow
control
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetDataPieExplode</span> ( string <span>graphcontrol</span>, integer <span>seriesnumber</span>, integer <span>datapoint</span>, integer <span>percentage</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SetDataPieExplode</span> ( string <span>graphcontrol</span>, number <span>seriesnumber</span>, number <span>datapoint</span>, number <span>percentage</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control |
graphcontrol |
A string whose value is the name of the |
seriesnumber |
The number that identifies the series. |
datapoint |
The number of the data point (that is, |
percentage |
A number between 0 and 100 that is the |
Return Values
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, SetDataPieExplode 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 the DataWindow control:
1 |
integer series, datapoint |
1 |
grObjectType clickedtype |
1 |
integer percentage |
1 |
1 |
percentage = 50 |
1 |
IF (This.GraphType <> PieGraph! AND & |
1 |
This.GraphType <> Pie3D!) THEN RETURN |
1 |
1 |
clickedtype = This.ObjectAtPointer( "gr_equipment", & |
1 |
series, datapoint) |
1 |
1 |
IF (series > 0 and datapoint > 0) THEN |
1 |
This.<span>SetDataPieExplode</span>("gr_equipment", series, & |
1 |
datapoint, percentage) |
1 |
END IF |