SetDataStyle

Specifies the appearance of a data point in a graph. The data point’s series has appearance settings that you can override with SetDataStyle.

To

Use

Set the data point’s colors

For the Web ActiveX, called SetDataStyleColor

Syntax 1 For setting a data point’s colors

Set the line style and width for the data point

For the Web ActiveX ,called SetDataStyleLine

Syntax 2 For the line associated with a data point

Set the fill pattern for the data point

For the Web ActiveX, called SetDataStyleFill

Syntax 3 For the fill pattern of a data point

Set the symbol for the data point

For the Web ActiveX, called SetDataStyleSymbol

Syntax 4 For the symbol of a data point


Syntax 1 For setting a data point’s colors

Description

Specifies the colors of a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.SetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, grColorType colortype, long color )

Web ActiveX

number dwcontrol.SetDataStyleColor ( string graphcontrol, number seriesnumber, number datapointnumber, number colortype, number color )

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 to set the color of a data point.

datapointnumber

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

colortype

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

For a list of values, see grColorType.

color

A long whose value is the new color for colortype.

Returns

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.

To reset the color of individual points back to the series color, call ResetDataColors.

You can specify the appearance of a data point in the graph before the application draws the graph. To do so:

NoteUsing SetDataStyle with DirectX 3D Graphs You can only set the color for the foreground. Background, line color, and shade are not supported.

Examples

Example 1

PowerBuilder These statements set the text (foreground) color to black for data point 6 in the series named Salary in the graph gr_depts in the DataWindow control dw_employees:

integer SeriesNbr


// Get the number of the series

SeriesNbr = &

		dw_employees.FindSeries("gr_depts" , "Salary")


// Set the background color

dw_employees.SetDataStyle("gr_depts" , SeriesNbr, &

		6, Background!, 0)

See also


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

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.SetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, LineStyle linestyle, { integer linewidth } )

Web ActiveX

number dwcontrol.SetDataStyle ( string graphcontrol, number seriesnumber, number datapointnumber, number linestyle, number linewidth )

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 to set the line style and width of a data point.

datapointnumber

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

linestyle

A value of the LineStyle enumerated datatype (in PowerBuilder) or an integer (for the Web ActiveX) specifying a line style pattern of dots, dashes, and solid lines. For a list of line style values, see LineStyle.

linewidth (optional for PowerBuilder)

An integer whose value is the width of the line in pixels.

Returns

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:

Examples

Example 2

PowerBuilder 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:

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


Syntax 3 For the fill pattern of a data point

Description

Specifies the fill pattern for a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.SetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, FillPattern fillvalue )

Web ActiveX

number dwcontrol.SetDataStyleFill ( string graphcontrol, number seriesnumber, number datapointnumber, number fillvalue )

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 to set the appearance of a data point.

datapointnumber

The number of the data point for which you want to set the appearance.

fillvalue

A value of the FillPattern enumerated datatype (in PowerBuilder) or an integer (for the Web ActiveX) specifying the fill pattern for the data point.

For a list of values, see FillPattern.

Returns

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:

NoteUsing SetDataStyle with DirectX 3D Graphs You cannot use a fill pattern for a data point.

See also


Syntax 4 For the symbol of a data point

Description

Specifies the symbol for a data point in a graph.

Applies to

PowerBuilder DataWindow DataWindow control

DataWindow Web ActiveX DataWindow control

Syntax

PowerBuilder

integer dwcontrol.SetDataStyle ( string graphcontrol, integer seriesnumber, integer datapointnumber, grSymbolType symbolvalue )

Web ActiveX

number dwcontrol.SetDataStyleSymbol ( string graphcontrol, number seriesnumber, number datapointnumber, number symbolvalue )

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 to set the appearance of a data point.

datapointnumber

The number of the data point for which you want to set the appearance.

symbolvalue

A value of the grSymbolType enumerated datatype (in PowerBuilder) or an integer (for the Web ActiveX) specifying the symbol for the data point.

For a list of values, see grSymbolType.

Returns

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:

NoteUsing SetDataStyle with DirectX 3D Graphs You cannot specify specific symbols for the data point.

See also