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.
Controls
PowerBuilder DataWindow DataWindow
control
DataWindow Web ActiveX DataWindow
control
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetDataStyle</span> ( string <span>graphcontrol</span>, integer <span>seriesnumber</span>, integer <span>datapointnumber</span>, LineStyle <span>linestyle</span>, { integer <span>linewidth</span> } ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SetDataStyle</span> ( string <span>graphcontrol</span>, number <span>seriesnumber</span>, number <span>datapointnumber</span>, number <span>linestyle</span>, number <span>linewidth</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control |
graphcontrol |
A string whose value is the name of the |
seriesnumber |
The number of the series in which you |
datapointnumber |
The number of the data point for which |
linestyle |
A value of the LineStyle enumerated datatype |
linewidth (optional for |
An integer whose value is the width of |
Return Values
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.
You can specify the appearance of a data point in the graph
before the application draws the graph. To do so:
-
PowerBuilder
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. -
Web ActiveX
Call any of the SetDataStyle methods in
code for the onGraphCreate event.
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 |
integer SeriesNbr, line_width |
1 |
LineStyle line_style |
1 |
1 |
// Get the number of the series |
1 |
SeriesNbr = dw_equipment.FindSeries( & |
1 |
"gr_computers", "Costs") |
1 |
1 |
// Get the current line style |
1 |
dw_equipment.GetDataStyle("gr_computers", & |
1 |
SeriesNbr, 10, line_style, line_width) |
1 |
1 |
// If the pattern is dash-dot, change to continuous |
1 |
IF line_style = DashDot! THEN & |
1 |
dw_equipment.<span>SetDataStyle</span>("gr_computers", & |
1 |
SeriesNbr, 10, Continuous!, line_width) |