GetSeriesStyle

Finds out the appearance of a series in a graph. The appearance settings for individual data points can override the series settings, so the values obtained from GetSeriesStyle might not reflect the current state of the graph. There are several syntaxes, depending on what settings you want.

To

Use

Get the series’ colors

Web ActiveX The method is called GetSeriesStyleColor.

Syntax 1 For the colors of a series

Get the line style and width used by the series

Web ActiveX The method is called GetSeriesStyleLine.

Syntax 2 For the line style and width used by a series

Get the fill pattern for the series

Web ActiveX The method is called GetSeriesStyleFill.

Syntax 3 For the fill pattern of a series

Get the symbol for data points in the series

Web ActiveX The method is called GetSeriesStyleSymbol.

Syntax 4 For the symbol of a series

Find out if the series is an overlay (a series shown as a line on top of another graph type)

Web ActiveX The method is called GetSeriesStyleOverlay.

Syntax 5 For determining whether a series is an overlay

GetSeriesStyle provides information about a series. The data points in the series can have their own style settings. Use SetSeriesStyle to change the style values for a series. Use GetDataStyle to get style information for a data point and SetDataStyle to override series settings and set style information for individual data points.

The graph stores style information for properties that do not apply to the current graph type. For example, you can find out the fill pattern for a data point or a series in a two-dimensional line graph, but that fill pattern will not be visible.


Syntax 1 For the colors of a series

Description

Obtains the colors associated with a series in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetSeriesStyle ( string graphcontrol, string seriesname, grColorType colortype, REF long colorvariable )

Web ActiveX

number dwcontrol.GetSeriesStyleColor ( string graphcontrol, string seriesname, number colortype )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

seriesname

A string whose value is the name of the series for which you want the color.

colortype

A value of the grColorType enumerated datatype (in PowerBuilder) or an integer (for the Web ActiveX) specifying the aspect of the series for which you want the color.

For a list of values, see grColorType.

colorvariable

In PowerBuilder, a long variable in which you want to store the color’s RGB value.

For the Web ActiveX, call GetSeriesStyleColorValue to get the value.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, stores in colorvariable the RGB value of the specified series and item. If any argument’s value is null, GetSeriesStyle returns null.

Examples

Example 1

These statements store in the variable color_nbr the background color used for the series PCs in the graph gr_computers in the DataWindow control dw_equipment:

long color_nbr

// Get the color.

dw_equipment.GetSeriesStyle("gr_computers", &

		"PCs", Background!, color_nbr)

See also


Syntax 2 For the line style and width used by a series

Description

Obtains the line style and width for a series in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetSeriesStyle ( string graphcontrol, string seriesname, REF LineStyle linestyle {, REF integer linewidth } )

Web ActiveX

number dwcontrol.GetSeriesStyleLine ( string graphcontrol, string seriesname )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

seriesname

A string whose value is the name of the series for which you want the line style information.

linestyle

In PowerBuilder, a variable of type LineStyle in which you want to store the line style of seriesname. For the Web ActiveX, call GetSeriesStyleLineStyle to get the value. For a list of values, see LineStyle.

linewidth

(optional)

In PowerBuilder, an integer variable in which you want to store the line width for seriesname. The width is measured in pixels. For the Web ActiveX, call GetSeriesStyleLineWidth to get the value.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, stores in linestyle a value of the LineStyle enumerated datatype and in linewidth the width of the line used for the specified series. If any argument’s value is null, GetSeriesStyle returns null.

Examples

Example 2

These statements store in the variables line_style and line_width the line style and width for the series under the mouse pointer in the graph gr_product_data:

string SeriesName

integer SeriesNbr, Data_Point, line_width

LineStyle line_style

grObjectType MouseHit


MouseHit = dw_equipment.ObjectAtPointer &

	("gr_product_data", SeriesNbr, Data_Point)


IF MouseHit = TypeSeries! THEN

	 SeriesName = &

			dw_equipment.SeriesName("gr_product_data", &

				SeriesNbr)


	 dw_equipment.GetSeriesStyle ("gr_product_data", &

			SeriesName, line_style, line_width)

END IF

See also


Syntax 3 For the fill pattern of a series

Description

Obtains the fill pattern of a series in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetSeriesStyle ( string graphcontrol, string seriesname, REF FillPattern fillvariable )

Web ActiveX

number dwcontrol.GetSeriesStyleFill ( string graphcontrol, string seriesname )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

seriesname

A string whose value is the name of the series for which you want the style information.

fillvariable

In PowerBuilder, a variable of type FillPattern in which you want to store the fill pattern value. For the Web ActiveX, call GetSeriesStyleFillPattern to get the value. For a list of values, see FillPattern.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, stores in fillvariable identifying the fill pattern for the specified series. If any argument’s value is null, GetSeriesStyle returns null.

Examples

Example 3

This example stores in the variable data_pattern the fill pattern for the series under the pointer in the graph gr_depts in the DataWindow control dw_employees. It then sets the fill pattern for the series Total Salary in the graph gr_dept_data to that pattern:

string SeriesName

integer SeriesNbr, Data_Point

FillPattern data_pattern

grObjectType MouseHit


MouseHit = dw_employees.ObjectAtPointer("gr_depts" , &

		SeriesNbr, Data_Point)


IF MouseHit = TypeSeries! THEN

		SeriesName = &

			dw_employees.SeriesName("gr_depts" , SeriesNbr)


		dw_employees.GetSeriesStyle("gr_depts" , &

			SeriesName, data_pattern)


		gr_dept_data.SetSeriesStyle("Total Salary", &

			data_pattern)

END IF

See also


Syntax 4 For the symbol of a series

Description

Obtains the symbol used for data points in a series in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetSeriesStyle ( string graphcontrol, string seriesname, REF grSymbolType symbolvariable )

Web ActiveX

number dwcontrol.GetSeriesStyleSymbol ( string graphcontrol, string seriesname )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

seriesname

A string whose value is the name of the series for which you want the style information.

symbolvariable

In PowerBuilder, the variable of type grSymbolType in which you want to store the symbol value.

For the Web ActiveX, call GetSeriesStyleSymbolValue to get the value.

For a list of values, see grSymbolType.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, stores in symbolvariable a value of the grSymbolType enumerated datatype for the symbol used for the specified series. If any argument’s value is null, GetSeriesStyle returns null.

Examples

Example 4

This example stores in the variable data_pattern the fill pattern for the series under the pointer in the graph gr_depts in the DataWindow control dw_employees. It then sets the fill pattern for the series Total Salary in the graph gr_dept_data to that pattern:

string SeriesName

integer SeriesNbr, Data_Point

grSymbolType symbol

grObjectType MouseHit


MouseHit = dw_employees.ObjectAtPointer("gr_depts" , &

   SeriesNbr, Data_Point)


IF MouseHit = TypeSeries! THEN

   SeriesName = &

      dw_employees.SeriesName("gr_depts" , SeriesNbr)

      dw_employees.GetSeriesStyle("gr_depts" , &

			SeriesName, symbol

      gr_dept_data.SetSeriesStyle("Total Salary", &

			symbol)

END IF

See also


Syntax 5 For determining whether a series is an overlay

Description

Reports whether a series in a graph is an overlay—whether it is shown as a line on top of another graph type.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetSeriesStyle ( string  graphcontrol, string seriesname, REF boolean overlayindicator )

Web ActiveX

number dwcontrol.GetSeriesStyleOverlay ( string  graphcontrol, string seriesname )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

seriesname

A string whose value is the name of the series for which you want the overlay status.

overlayindicator

In PowerBuilder, a boolean variable in which you want to store a value indicating whether the series is an overlay. GetSeriesStyle sets overlayindicator to true if the series is an overlay and false if it is not.

For the Web ActiveX, call GetSeriesStyleOverlayValue to get the value instead of specifying the reference variable.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, stores in overlayindicator true if the specified series is an overlay and false if it is not. If any argument’s value is null, GetSeriesStyle returns null.

See also

GetSeriesStyleOverlayValue