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

Syntax 1 For the colors of a data point

Line style and width used by the data point

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

Fill pattern or symbol for the data point

Syntax 3 For the fill pattern or 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.

For the enumerated datatype values that GetDataStyle stores in linestyle and enumvariable, see SetDataStyle.


Syntax 1 For the colors of a data point

Description

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

Applies to

Graph controls in windows and user objects, and graphs in DataWindow controls

Syntax

controlname.GetDataStyle ( { graphcontrol, } seriesnumber,
  datapointnumber, colortype, colorvariable )

Argument

Description

controlname

The name of the graph for which you want the color of a data point, or the name of the DataWindow control containing the graph.

graphcontrol (Data Window control only)

(Optional) When controlname is a DataWindow control, the name of the graph for which you want the color of a data point.

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 specifying the aspect of the data point for which you want the color. Values are:

  • Background! — The background color

  • Foreground! — Text (fill color)

  • LineColor! — The color of the line

  • Shade! — The shaded area of three-dimensional graphics

colorvariable

A long variable in which you want to store the color.

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs. Stores a color value in colorvariable. If any argument’s value is null, GetDataStyle returns null.

Examples

Example 1

This example gets the text (foreground) color used for data point 6 in the series named Salary in the 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 = gr_emp_data.FindSeries("Salary")


// Get the color

gr_emp_data.GetDataStyle(SeriesNbr, 6, &

    Foreground!, color_nbr)

Example 2

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

Graph controls in windows and user objects, and graphs in DataWindow controls

Syntax

controlname.GetDataStyle ( { graphcontrol, } seriesnumber, 
  datapointnumber, linestyle, linewidth )

Argument

Description

controlname

The name of the graph for which you want the line style and width of a data point, or the name of the DataWindow control containing the graph.

graphcontrol (DataWindow control only)

(Optional) A string whose value is the name of the graph (in the DataWindow control) for which you want the line style and width of a data point.

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

A variable of type LineStyle in which you want to store the line style.

linewidth

An integer variable in which you want to store the width of the line. The width is measured in pixels.

Returns

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

Usage

For the enumerated datatype values that GetDataStyle will store in linestyle, see SetDataStyle.

Examples

Example 3

This example gets the line style and width of data point 10 in the series named Costs in the graph gr_product_data. It stores the information in the variables line_style and line_width:

integer SeriesNbr, line_width

LineStyle line_style


// Get the number of the series

SeriesNbr = gr_product_data.FindSeries("Costs")

gr_product_data.GetDataStyle(SeriesNbr, 10, &

    line_style, line_width)

Example 4

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 or symbol of a data point

Description

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

Applies to

Graph controls in windows and user objects, and graphs in DataWindow controls

Syntax

controlname.GetDataStyle ( { graphcontrol, } seriesnumber,
  datapointnumber, enumvariable )

Argument

Description

controlname

The name of the graph for which you want the fill pattern or symbol type of a data point, or the name of the DataWindow control containing the graph.

graphcontrol (DataWindow control only) (optional)

A string whose value is the name of the graph (in the DataWindow control) for which you want the fill pattern or symbol type of a data point.

seriesnumber

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

datapointnumber

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

enumvariable

The variable in which you want to store the data style. You can specify a FillPattern or grSymbolType variable. The data style information stored will depend on the variable type.

Returns

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

Usage

For the enumerated datatype values that GetDataStyle will store in enumvariable, see SetDataStyle.

Examples

Example 5

This example gets the pattern used to fill data point 10 in the series named Costs in the graph gr_product_data. The information is stored in the variable data_pattern:

integer SeriesNbr

FillPattern data_pattern


// Get the number of the series

SeriesNbr = gr_product_data.FindSeries("Costs")

gr_product_data.GetDataStyle(SeriesNbr, 10, &

    data_pattern)

Example 6

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)

Example 7

These statements store in the variable symbol_type the symbol of data point 10 in the series named Costs in the graph gr_product_data:

integer SeriesNbr

grSymbolType symbol_type


// Get the number of the series

SeriesNbr = gr_product_data.FindSeries("Costs")

gr_product_data.GetDataStyle(SeriesNbr, 10, &

    symbol_type)

Example 8

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