ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • Managing colors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Specifies the colors of different values in a Heatmap chart.
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_HMap)
Syntax
grHMColor(<Chart name> , <Level> , <Color>)
<Chart name>: Control name or character string
Name of the chart to be used. This name can correspond to:
  • the chart name defined through 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 can correspond 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.
Remark: 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 example presents the different uses of the Chart control.
Different types of charts are presented:
- Pie
- Sunburst
- Line
- Scatter
- Column
- Area
- etc.

The main features presented here are the possibility to customize of charts from the code, as well as to fill the chart from an HFSQL data file, or in the editor.
Component: wd290grf.dll
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help