ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • How to retrieve the components of the color?
  • Colors of chart elements (legends, ...)
  • Colors in the charts (series, section, ...)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
<Chart>.Color (Function)
In french: <Graphe>.Couleur
Returns and initializes the color of different chart elements.
Linux Caution: In Linux, this function requires a specific configuration. For more details, see The charts.
Example
// Modification des couleurs dans un champ Graphe
GRF_Graphe1.Couleur(grColorLegend, LightRed)
GRF_Graphe1.Dessine() // Bordure de la légende dessinée en rouge
GRF_Graphe1.Couleur(grColorLegend, LightBlue) // La bordure apparaît toujours en rouge
GRF_Graphe1.Dessine() // Bordure de la légende dessinée en bleu
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.
Warning The value returned may differ depending on the display configuration (resolution, etc.).
<Chart control>: Control name
Name of the Chart control to use (in the window, page or report editor).
PHP Only interactive Chart controls are available.
<Element>: Integer constant
Chart element whose color you want to get. This element can correspond to one of the following constants:
grColorAxisColor of axes.
grColorAxisSideColor of raised part of axes.
AndroidPHP This constant is not available.
grColorBorderColor 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.
grColorBullishCandlestickColor of bars in a candlestick when the closing value is greater than the opening value.
Android This constant is not available.
grColorGridlinesGridline color.
grColorGridlinesSideColor of raised part of gridlines.
AndroidPHP This constant is not available.
grColorLegendColor of legend border.
grColorLegendBackgroundLegend 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:
grColorAxisColor of axes.
grColorAxisSideColor of raised part of axes.
AndroidPHP This constant is not available.
grColorBorderColor 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.
grColorBullishCandlestickColor of bars in a candlestick when the closing value is greater than the opening value.
Android This constant is not available.
grColorGridlinesGridline color.
grColorGridlinesSideColor of raised part of gridlines.
AndroidPHP This constant is not available.
grColorLegendColor of legend border.
grColorLegendBackgroundLegend background color.
<New color>: Integer or constant (optional)
Color of the 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).
  • Print graph If white color is associated with axes (constant grColorAxis), gridlines (constant grGridColor), the legend (constant grLegendColor) and border (constant grColorBorder), then the drawing will be printed in black.

Colors in the charts (series, section, ...)

Component: wd300grf.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help