<Chart>.Color (Function) In french: <Graphe>.Couleur Returns and initializes the color of different chart elements.
// Modify the colors in a Chart control CHART_Chart1.Color(grColorLegend, LightRed) CHART_Chart1.Draw() // Border of the legend drawn in red CHART_Chart1.Color(grColorLegend, LightBlue) // The border is still red CHART_Chart1.Draw() // The border of the legend drawn in blue
Syntax
Finding out the color of an element in a Chart control Hide the details
<Result> = <Chart control>.Color(<Element>)
<Result>: Integer Color of the specified element in RGB format. Caution: The value returned may differ according to the display configuration (resolution, ...). <Chart control>: Control name Name of the Chart control to use (in the window, page or report editor).
<Element>: Integer constant Chart element whose color is requested. This element can correspond to one of the following constants:
| | grColorAxis | Color of axes. | grColorAxisSide | Color of raised part of axes.
| grColorBorder | Color of border for the chart elements (for the charts other than 3D charts). Used to find out the border color for a bar in a column chart for example. | grColorBullishCandlestick | Color of bars in a candlestick when the closing value is greater than the opening value.
| grColorGridlines | Gridline color. | grColorGridlinesSide | Color of raised part of gridlines.
| grColorLegend | Color of legend border. | grColorLegendBackground | Legend background color. |
Modifying the color of an element in a Chart control Hide the details
<Chart control>.Color(<Element> [, <New color>])
<Chart control>: Control name Name of the Chart control to use (in the window, page or report editor). <Element>: Integer constant Chart element whose color must be modified. This element can correspond to one of the following constants:
| | grColorAxis | Color of axes. | grColorAxisSide | Color of raised part of axes. | grColorBorder | Color of border for the chart elements (for the charts other than 3D charts). Used to find out the border color for a bar in a column chart for example. | grColorBullishCandlestick | Color of bars in a candlestick when the closing value is greater than the opening value. | grColorGridlines | Gridline color. | grColorGridlinesSide | Color of raised part of gridlines. | grColorLegend | Color of legend border. | grColorLegendBackground | Legend background color. |
<New color>: Integer or constant (optional) Color of specified element. This color can correspond to: Remarks How to retrieve the components of the color? To retrieve the components of the color returned by <Chart>.Color: - To get the red component, use RGBRed (or perform a division modulo 256 of <Result>),
- To get the green component, use RGBGreen (or perform a division modulo 256 of <Result>/256),
- To get the blue component, use RGBBlue (or perform a division modulo 256 of <Result>/256/256).
Colors of chart elements (legends, ...) - The settings defined with <Chart>.Color will be taken into account the next time <Chart>.Draw is called or the next time the chart is drawn (host control is resized, context menu is modified, etc.).
- The transparent color can only be used for the background color of the legend (grColorLegendBackground constant).
- Printing the chart: If the white color is associated with the axes (grColorAxis constant), with the gridlines (grColorGridlines constant), with the legend (grColorLegend constant) and with the border (grColorBorder constant), the drawing will be printed in black.
Colors in the charts (series, section, ...)
This page is also available for…
|
|
|
|