Syntax 1: For the colors of a series
Description
Obtains the colors associated with a series in a graph.
Applies to
Graph controls in windows and user objects, and graphs in
DataWindow controls
Syntax
|
1 |
controlname.GetSeriesStyle ( { graphcontrol, } seriesname, colortype, colorvariable ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want to obtain the |
|
graphcontrol (DataWindow control only) |
(Optional) A string whose value is the name of the graph |
|
seriesname |
A string whose value is the name of the series for which |
|
colortype |
A value of the grColorType enumerated datatype
|
|
colorvariable |
A long variable in which you want to store the color’s |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. Stores in
colorvariable the RGB value of the specified series and item. If any
argument’s value is null, GetSeriesStyle returns null.
Examples
These statements store in the variable color_nbr the text
(foreground) color used for a series in the graph gr_emp_data. The
series name is the text in the SingleLineEdit sle_series:
|
1 2 3 |
long color_nbr gr_emp_data.GetSeriesStyle(sle_series.Text, & Foreground!, color_nbr) |
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:
|
1 2 3 4 |
long color_nbr // Get the color. dw_equipment.GetSeriesStyle("gr_computers", & "PCs", Background!, color_nbr) |
These statements store the color for the series under the mouse
pointer in the graph gr_product_data in line_color:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
string SeriesName integer SeriesNbr, Data_Point long line_color grObjectType MouseHit MouseHit = ObjectAtPointer(SeriesNbr, Data_Point) IF MouseHit = TypeSeries! THEN SeriesName = & gr_product_data.SeriesName(SeriesNbr) gr_product_data.GetSeriesStyle(SeriesName, & LineColor!, line_color) END IF |
See also