GetDataStyle

Finds out the appearance of a data point in a graph. Each data point in a series can have individual appearance settings. There are different syntaxes, depending on what settings you want to check.

To get the

Use

Data point’s colors (called GetDataStyleColor in JavaScript)

Syntax 1 For the colors of a data point

Line style and width used by the data point (called GetDataStyleLine in JavaScript)

Syntax 2 For the line style and width used by a data point

Fill pattern for the data point (called GetDataStyleFill in JavaScript)

Syntax 3 For the fill pattern of a data point

Symbol for the data point (called GetDataStyleSymbol in JavaScript)

Syntax 4 For the symbol of a data point

GetDataStyle provides information about a single data point. The series to which the data point belongs has its own style settings. In general, the style values for the data point are the same as its series’ settings. Use SetDataStyle to change the style values for individual data points. Use GetSeriesStyle and SetSeriesStyle to get and set style information for the series.

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 2-dimensional line graph, but that fill pattern will not be visible.


Syntax 1 For the colors of a data point

Description

Obtains the colors associated with a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, grColorType colortype, REF long colorvariable )

Web ActiveX

number dwcontrol.GetDataStyleColor ( string graphcontrol, number seriesnumber, number datapointnumber, 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.

seriesnumber

The number of the series in which you want the color of a data point.

datapointnumber

The number of the data point for which you want the color.

colortype

A value of the grColorType enumerated datatype (in PowerBuilder) or an integer (in JavaScript) specifying the aspect of the data point 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.

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, GetDataStyle stores an RGB color value in colorvariable. If any argument’s value is null, GetDataStyle returns null.

Examples

Example 1

This example gets the background color used for data point 6 in the series entered in the SingleLineEdit sle_series in the DataWindow graph gr_emp_data. It stores the color value in the variable color_nbr:

long color_nbr

integer SeriesNbr


// Get the number of the series

SeriesNbr = &

		FindSeries("gr_emp_data", sle_series.Text)


// Get the color

dw_emp_data.GetDataStyle("gr_emp_data", &

		SeriesNbr, 6, Background!, color_nbr)

See also


Syntax 2 For the line style and width used by a data point

Description

Obtains the line style and width for a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, REF LineStyle linestyle, REF integer linewidth )

Web ActiveX

number dwcontrol.GetDataStyleLine ( string graphcontrol, number seriesnumber, number datapointnumber  )

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.

seriesnumber

The number of the series in which you want the line style and width of a data point.

datapointnumber

The number of the data point for which you want the line style and width.

linestyle

In PowerBuilder, a variable of type LineStyle in which you want to store the line style.

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

For a list of line style values, see LineStyle.

linewidth

In PowerBuilder, an integer variable in which you want to store the width of the line. The width is measured in pixels.

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

Returns

Returns 1 if it succeeds and -1 if an error occurs. In PowerBuilder, for the specified series and data point, GetDataStyle stores its line style in linestyle and the line’s width in linewidth. If any argument’s value is null, GetDataStyle returns null.

Examples

Example 2

This example gets the line style and width for data point 6 in the series entered in the SingleLineEdit sle_series in the graph gr_depts in the DataWindow control dw_employees. The information is stored in the variables line_style and line_width:

integer SeriesNbr, line_width

LineStyle line_style


// Get the number of the series

SeriesNbr = dw_employees.FindSeries( &

		"gr_depts", sle_series.Text)


// Get the line style and width

dw_employees.GetDataStyle("gr_depts", SeriesNbr, &

		6, line_style, line_width)

See also


Syntax 3 For the fill pattern of a data point

Description

Obtains the fill pattern of a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, REF FillPattern fillvariable )

Web ActiveX

number dwcontrol.GetDataStyleFill ( string graphcontrol, number seriesnumber, number datapointnumber )

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.

seriesnumber

The number of the series in which you want the fill pattern of a data point.

datapointnumber

The number of the data point for which you want the fill pattern.

fillvariable

In PowerBuilder, a variable of type FillPattern in which you want to store the fill pattern value.

In the Web ActiveX, call GetDataStyleFillPattern 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, GetDataStyle stores a value of the FillPattern enumerated datatype representing the fill pattern used for the specified data point. If any argument’s value is null, GetDataStyle returns null.

Examples

Example 3

This example gets the pattern used to fill data point 6 in the series entered in the SingleLineEdit sle_series in the graph gr_depts in the DataWindow control dw_employees. The information is assigned to the variable data_pattern:

integer SeriesNbr

FillPattern data_pattern


// Get the number of the series

SeriesNbr = dw_employees.FindSeries("gr_depts", &

		sle_series.Text)


// Get the pattern

dw_employees.GetDataStyle("gr_depts", SeriesNbr, &

		6, data_pattern)

See also


Syntax 4 For the symbol of a data point

Description

Obtains the symbol of a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, REF grSymbolType symbolvariable )

Web ActiveX

number dwcontrol.GetDataStyleSymbol (string graphcontrol, number seriesnumber, number datapointnumber )

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.

seriesnumber

The number of the series in which you want the symbol type of a data point.

datapointnumber

The number of the data point for which you want the symbol type.

symbolvariable

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

In the Web ActiveX, call GetDataStyleSymbolValue to get the value instead of using a reference variable.

For a list of values, see grSymbolType.

Returns

Returns 1 if it succeeds and -1 if an error occurs. Stores, according to the type of symbolvariable, a value of that enumerated datatype representing the symbol used for the specified data point. If any argument’s value is null, GetDataStyle returns null.

Examples

Example 4

These statements store the symbol for a data point in the variable symbol_type. The data point is the sixth point in the series named in the SingleLineEdit sle_series in the graph gr_depts in the DataWindow control dw_employees:

integer SeriesNbr

grSymbolType symbol_type


// Get the number of the series

SeriesNbr = dw_employees.FindSeries("gr_depts", &

		sle_series.Text)


// Get the symbol

dw_employees.GetDataStyle("gr_depts", SeriesNbr, &

		6, symbol_type)

See also