Syntax 1 For the colors of a series
Description
Obtains the colors associated with a series in a graph.
Controls
Graph controls in windows and user objects, and graphs in
DataWindow controls
Syntax
|
1 |
<span>controlname</span>.<span>GetSeriesStyle</span> ( { <span>graphcontrol</span>, } <span>seriesname</span>, <span>colortype</span>, <span>colorvariable</span> ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want |
|
graphcontrol (DataWindow control |
(Optional) A string whose value is the |
|
seriesname |
A string whose value is the name of the |
|
colortype |
A value of the grColorType enumerated
|
|
colorvariable |
A long variable in which you want to |
Return Values
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 |
long color_nbr |
|
1 |
gr_emp_data.<span>GetSeriesStyle</span>(sle_series.Text, & |
|
1 |
   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 |
long color_nbr |
|
1 |
// Get the color. |
|
1 |
dw_equipment.<span>GetSeriesStyle</span>("gr_computers", & |
|
1 |
   "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 |
string SeriesName |
|
1 |
integer SeriesNbr, Data_Point |
|
1 |
long line_color |
|
1 |
grObjectType MouseHit |
|
1 |
|
1 |
MouseHit = ObjectAtPointer(SeriesNbr, Data_Point) |
|
1 |
|
1 |
IF MouseHit = TypeSeries! THEN |
|
1 |
   SeriesName = & |
|
1 |
      gr_product_data.SeriesName(SeriesNbr) |
|
1 |
|
1 |
   gr_product_data.<span>GetSeriesStyle</span>(SeriesName, & |
|
1 |
      LineColor!, line_color) |
|
1 |
END IF |