PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • How to retrieve the components of the color?
  • Colors of chart elements (legends, ...)
  • Colors in the charts (series, section, ...)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
grColor (Function)
In French: grCouleur
Returns and initializes the color of different chart elements.
Versions 15 and later
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Linux Caution: A specific configuration is required to use this function in Linux. See The charts for more details.
New in version 15
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Linux Caution: A specific configuration is required to use this function in Linux. See The charts for more details.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Linux Caution: A specific configuration is required to use this function in Linux. See The charts for more details.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 19 and later
Android This function is now available for the Android applications.
New in version 19
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 23 and later
PHP This function is now available for the PHP sites.
New in version 23
PHP This function is now available for the PHP sites.
PHP This function is now available for the PHP sites.
Example
// Modify the colors in a Chart control
grColor(CHART_Chart1, grColorLegend, LightRed)
grDraw(CHART_Chart1) // Border of the legend drawn in red
grColor(CHART_Chart1, grColorLegend, LightBlue) // The border is still red
grDraw(CHART_Chart1) // Border of the legend drawn in blue
Syntax

Finding out the color of a chart element Hide the details

<Result> = grColor(<Chart Name> , <Element>)
<Result>: Integer
Color of specified element in RGB format.
Caution: The value returned may differ according to the display configuration (resolution, ...).
<Chart Name>: Character string (with or without quotes)
Name of chart to use. This name corresponds to:
  • the chart name defined by programming with grCreate.
  • the name of Chart control found in the window editor, page editor or report editor.
Android Only the Chart controls are available.
PHP Only the interactive Chart controls are available.
<Element>: Integer constant
Chart element whose color is requested. 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.
grColorLegendColor of legend border.
grColorLegendBackgroundBackground color of legend.
grColorGridlinesColor of gridlines.
grColorGridlinesSideColor of raised part of gridlines.
AndroidPHP This constant is not available.

Modifying the color of a chart element Hide the details

grColor(<Chart Name> , <Element> [, <New Color>])
<Chart Name>: Character string (with quotes)
Name of chart to use. This name corresponds to:
  • the chart name defined by programming with grCreate.
  • the name of Chart control found in the window editor, page editor or report editor.
Android Only the Chart controls are available.
<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.
grColorLegendColor of legend border.
grColorLegendBackgroundBackground color of legend.
grColorGridlinesColor of gridlines.
grColorGridlinesSideColor of raised part of gridlines.
AndroidPHP This constant is not available.
<New Color>: Integer or constant (optional)
Color of specified element. This color corresponds to:
Remarks

How to retrieve the components of the color?

To retrieve the components of the color returned by grColor:
  • 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 setting performed by grColor will be taken into account during the next call to grDraw or during the next drawing of the chart (when resizing the host control, when modifying the popup menu, ...).
  • 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, ...)

  • The color of Bearish candlesticks is defined by the color of the series.
  • grSeriesColor is used to modify the color of a series.
  • Versions 19 and later
    grCategoryColor is used to modify the color of categories for the Pie and Color charts.
    New in version 19
    grCategoryColor is used to modify the color of categories for the Pie and Color charts.
    grCategoryColor is used to modify the color of categories for the Pie and Color charts.
  • grScatterSeriesColor is used to initialize the color of a series in a "Scatter" chart.
  • Versions 20 and later
    grSunburstSectionColor is used to change the color of a section in a Sunburst chart.
    New in version 20
    grSunburstSectionColor is used to change the color of a section in a Sunburst chart.
    grSunburstSectionColor is used to change the color of a section in a Sunburst chart.
  • Versions 18 and later
    grSurfaceAltitudeColor is used to define the color used for the altitude (Z axis) in a Surface chart.
    New in version 18
    grSurfaceAltitudeColor is used to define the color used for the altitude (Z axis) in a Surface chart.
    grSurfaceAltitudeColor is used to define the color used for the altitude (Z axis) in a Surface chart.
  • Versions 19 and later
    grWaterfallColor indicates the color for a type of category in a Waterfall chart.
    New in version 19
    grWaterfallColor indicates the color for a type of category in a Waterfall chart.
    grWaterfallColor indicates the color for a type of category in a Waterfall chart.
  • Versions 21 and later
    grHMColor is used to define the color of values in a Heatmap chart.
    New in version 21
    grHMColor is used to define the color of values in a Heatmap chart.
    grHMColor is used to define the color of values in a Heatmap chart.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230grf.dll
Windows Mobile wp230grf.dll
Linux wd230grf.so
Android wd230android.jar
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment