GetDataPieExplode method (Graphs in DataWindows)
Description
Reports the percentage of the pie graph’s radius
that a pie slice is moved away from the center of the pie graph.
An exploded slice is moved away from the center of the pie in order
to draw attention to the data.
Controls
PowerBuilder DataWindow DataWindow
control
DataWindow Web ActiveX DataWindow
control
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>GetDataPieExplode</span> ( string <span>graphcontrol</span>, integer <span>series</span>, integer <span>datapoint</span>, REF integer <span>percentage</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>GetDataPieExplode</span> ( string <span>graphcontrol</span>, number <span>series</span>, number <span>datapoint</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control |
graphcontrol |
A string whose value is the name of the |
series |
The number that identifies the series |
datapoint |
The number of the exploded data point |
percentage |
An integer variable in which you want |
Return Values
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, GetDataPieExplode returns
null.
Examples
This example reports the percentage that a pie slice
is exploded when the user clicks on that slice. The code checks
whether the graph is a pie graph using the property GraphType. 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 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 |
clickedtype = This.ObjectAtPointer(series, & |
1 |
datapoint) |
1 |
1 |
IF (series > 0 and datapoint > 0) THEN |
1 |
This.<span>GetDataPieExplode</span>("gr_sales_yr", series, & |
1 |
datapoint, percentage) |
1 |
MessageBox("Explosion Percentage", & |
1 |
"Data point " + This.CategoryName(datapoint) & |
1 |
+ " in series " + This.SeriesName(series) & |
1 |
+ " is exploded " + String(percentage) + "%") |
1 |
END IF |