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
|
1 |
controlname.GetDataStyle ( { graphcontrol, } seriesnumber, datapointnumber, colortype, colorvariable ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph for which you want the color of a |
|
graphcontrol (Data Window control only) |
(Optional) When controlname is a DataWindow control, the |
|
seriesnumber |
The number of the series in which you want the color of |
|
datapointnumber |
The number of the data point for which you want the |
|
colortype |
A value of the grColorType enumerated datatype
|
|
colorvariable |
A long variable in which you want to store the |
Return value
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
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:
|
1 2 3 4 5 6 7 8 9 |
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) |
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:
|
1 2 3 4 5 6 7 8 9 |
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