PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE


  • Managing colors
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
grHMColor (Function)
In French: grHMCouleur
Specifies the colors of different values in a Heatmap chart.
Versions 22 and later
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
New in version 22
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
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
// Define the colors
grHMColor(CHART_HMap, -50, DarkBlue)
grHMColor(CHART_HMap, +50, LightRed)
FOR i = 1 TO 500
grHMAddData(CHART_HMap, Random(-100, 100), Random(-100, 100), -100)
grHMAddData(CHART_HMap, Random(-100, 100), Random(-100, 100), 100)
END
grDraw(CHART_NoName1)
Syntax
grHMColor(<Chart> , <Level> , <Color>)
<Chart>: 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 or report editor.
PHP Only the interactive Chart controls are available.
<Level>: Real or Constant
Level from which the color will be applied. Corresponds to:
  • a real value,
  • the grHMColorEmptyValue constant. In this case, the color will be applied to the data outside level or without value. This color is transparent by default.
<Color>: Integer or Integer constant
Color that will be given to the level. This color corresponds to:
  • an RGB color (returned by RGB),
  • an HSL color (returned by HSL),
  • a preset color (see the preset colors of WLanguage).
  • the AutomaticColor constant. In this case, the level is deleted.
Remarks

Managing colors

The colors are defined by level. For the values found between 2 levels, a linear gradient is applied by default.
This behavior can be modified by grParameter associated with the grHMDisplayColor constant. The following syntax is used:
grParameter(<Chart Name>, grHMDisplayColor, <Display Type>)

where <Display Type> corresponds to one of the following constants:
grColorGradient
(Default value)
A linear gradient is applied to the intermediate values.
grLowerLevelThe display of colors is done by level. All the values less than or equal to the level will take the color given by grHMColor.
grHigherLevelThe display of colors is done by level. All the values greater than or equal to the level will take the color given by grHMColor.

For the facets outside color bounds or without value, the color specified by grHMColorEmptyValue will be applied. This color is transparent by default.
Note: The colors defined by grHMColor will be taken into account during the next call to grDraw.
Related Examples:
WD Chart Training (WINDEV): WD Chart
[ + ] This educational example present different uses of the chart control.
The following charts are presented:
- Semi-circular
- Donut
- Pie
- Sunburst
- Line
- Scatter
- 3D Scatter
- Column
- Area
- Bubble
- Radar
- Funnel
- Surface
- Waterfall
- Composite

The main features presented in this example are the ability to customize the charts by programming as well as the method used to fill a chart from a HFSQL file or in the editor.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230grf.dll
Linux wd230grf.so
Minimum required version
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment