Syntax 4 For creating an overlay in a graph
Description
Specifies whether a series is an overlay, meaning that the
series is represented by a line on top of another graph type.
Controls
Graph controls in windows and user objects, and graphs in
DataWindow controls
Syntax
1 |
<span>controlname</span>.<span>SetSeriesStyle</span> ( { <span>graphcontrol</span>, } <span>seriesname</span>, <span>overlaystyle</span> ) |
Argument |
Description |
---|---|
controlname |
The name of the graph in which you want |
graphcontrol (DataWindow control |
A string whose value is the name of the |
seriesname |
A string whose value is the name of the |
overlaystyle |
A boolean value indicating whether you |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs. If any argument’s value is null, SetSeriesStyle returns null.
Usage
For a graph in a DataWindow, you can specify the appearance
of a series in the graph before PowerBuilder draws the graph. To
do so, define a user event for pbm_dwngraphcreate and
call SetSeriesStyle in the script for that event.
The event pbm_dwngraphcreate is triggered
just before a graph is created in a DataWindow object.
You cannot use the overlay style for a series.
Examples
This statement sets the style of the series named Costs in
the graph gr_product_data to
overlay:
1 |
gr_product_data.<span>SetSeriesStyle</span>("Costs", TRUE) |
These statements in the Clicked event of the DataWindow
control dw_employees store the style
of the series under the pointer in the graph gr_depts in
the variable style_type. If the style
of the series is overlay (true), the script changes
the style to normal (false):
1 |
string SeriesName |
1 |
integer SeriesNbr, Data_Point |
1 |
boolean overlay_style |
1 |
grObjectType MouseHit |
1 |
1 |
MouseHit = dw_employees.ObjectAtPointer( & |
1 |
"gr_depts", SeriesNbr, Data_Point) |
1 |
1 |
IF MouseHit = TypeSeries! THEN |
1 |
SeriesName = & |
1 |
dw_employees.SeriesName("gr_depts",SeriesNbr) |
1 |
1 |
dw_employees.GetSeriesStyle("gr_depts", & |
1 |
SeriesName, overlay_style) |
1 |
1 |
IF overlay_style THEN & |
1 |
dw_employees.<span>SetSeriesStyle</span>("gr_depts", & |
1 |
SeriesName, FALSE) |
1 |
END IF |