ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
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
Initializes the category color for a chart whose type is:
  • Pie,
  • Column,
  • Bubble chart,
  • Waterfall.
By default, the colors of categories (or the colors of sections, bubbles, ...) are selected according to a preset order among a set of 11 colors.
Linux Caution: A specific configuration is required to use this function in Linux. For more details, see The charts.
Example
// Modifies the color of category 3 in the "CHART_Chart1" control
grCategoryColor(CHART_Chart1, 3, LightRed)
Syntax
grCategoryColor(<Chart name> , <Category number> , <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 the Chart control in the window, page or report editor.
<Category number>: Integer
Number of the category to modify.
For a Pie chart (grPie constant), this parameter corresponds to the subscript of data in the series (the section number). In this case, this function is equivalent to grSeriesColor.
For a Column chart (grColumn constant), this parameter corresponds to the category subscript: all the bars of the category will be colored. The colors specified for the category series will be ignored.
For a Bubble chart (grBubbleChart constant), this parameter corresponds to the category subscript: the bubble corresponding to the category will be colored.
<Color>: Integer or Integer constant
Color of specified category. This color can correspond to:
Remarks
  • The colors defined by grCategoryColor will be taken into account during the next call to grDraw.
  • To display the color gradients, use grGradient.
  • The colors specified by grCategoryColor are taken into account in the Waterfall charts. You also have the ability to define the colors of categories in the Waterfall charts with grWaterfallColor.
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.
Business / UI classification: Neutral code
Component: wd300grf.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/21/2023

Send a report | Local help