Home | Sign in | English EN

  • Managing colors
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Specifies the colors of different values in a Heatmap chart.
// Define the colors
CHART_HMap.HMColor(-50, DarkBlue)
CHART_HMap.HMColor(+50, LightRed)
FOR i = 1 TO 500
CHART_HMap.HMAddData(Random(-100, 100), Random(-100, 100), -100)
CHART_HMap.HMAddData(Random(-100, 100), Random(-100, 100), 100)
<Chart control>.HMColor(<Level> , <Color>)
<Chart control>: Control name
Name of the Chart control to use (found in the window editor or in the report editor).
<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.

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 <Chart>.Parameter associated with the grHMDisplayColor constant. The following syntax is used:
<Chart control>.Parameter(grHMDisplayColor, <Display type>)

where <Display Type> corresponds to one of the following constants:
(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 <Chart>.HMColor.
grHigherLevelThe display of colors is done by level. All the values greater than or equal to the level will take the color given by <Chart>.HMColor.

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 <Chart>.HMColor will be taken into account during the next call to <Chart>.Draw.
Related Examples:
WD Chart Training (WINDEV): WD Chart
[ + ] This example shows the 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
- Comparative

The main features presented in this example are the customization of charts by programming, as well as the method used to fill a chart from an HFSQL file or in the editor.
Component : wd260grf.dll
Minimum version required
  • Version 23
This page is also available for…
Click [Add] to post a comment