Syntax 2: For the line associated with a data point
Description
Specifies the style and width of a data point’s line in a
graph.
Applies to
Graph controls in windows and user objects, and graphs in
DataWindow controls
Syntax
|
1 |
controlname.SetDataStyle ( { graphcontrol, } seriesnumber, datapointnumber, linestyle, linewidth ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want to set the line |
|
graphcontrol (DataWindow control only) (optional) |
A string whose value is the name of the graph in the |
|
seriesnumber |
The number of the series in which you want to set the |
|
datapointnumber |
The number of the data point for which you want to set |
|
linestyle |
A value of the LineStyle enumerated datatype. Values Continuous! Dash! DashDot! DashDotDot! Dot! Transparent! |
|
linewidth |
An integer whose value is the width of the line in |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, SetDataStyle returns null.
Usage
To change the appearance of a series, use SetSeriesStyle. The
settings you make for the series are the defaults for all data points in
the series.
For a graph in a DataWindow, you can specify the appearance of a
data point in the graph before PowerBuilder draws the graph. To do so,
define a user event for pbm_dwngraphcreate and call SetDataStyle in the
script for that event. The event pbm_dwngraphcreate is triggered just
before a graph is created in a DataWindow object.
Examples
This example checks the line style used for data point 10 in the
series named Costs in the graph gr_computers in the DataWindow control
dw_equipment. If it is dash-dot, the SetDataStyle sets it to continuous.
The line width stays the same:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
integer SeriesNbr, line_width LineStyle line_style // Get the number of the series SeriesNbr = dw_equipment.FindSeries( & "gr_computers", "Costs") // Get the current line style dw_equipment.GetDataStyle("gr_computers", & SeriesNbr, 10, line_style, line_width) // If the pattern is dash-dot, change to continuous IF line_style = DashDot! THEN & dw_equipment.SetDataStyle("gr_computers", & SeriesNbr, 10, Continuous!, line_width) |
See also