ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • Handling the category labels
  • Initializing fonts
  • Orientation of the font
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
Modifies the font used for the category labels of a chart.
Category label
Linux Caution: A specific configuration is required to use this function in Linux. For more details, see The charts.
Example
// Modify the font of labels for the axes of Chart control: CHART_Chart
 
// Create a specific font
fntLabel is Font
fntLabel.Name = "Verdana"
fntLabel.Size = 10
fntLabel.Bold = True
 
// Change the font
grLabelFont(CHART_Chart, fntLabel)
grDraw(CHART_Chart)
// Use the syntax kept for backward compatibility
// Modify the font used for the labels of "MyChart"
// The identifier of font used is 7
grLabelFont("MyChart", 7)
Syntax

Defining the font used for the chart labels Hide the details

grLabelFont(<Chart name> , <Font used>)
<Chart name>: Control name or character string
Name of the chart to be used. This name corresponds to:
  • the chart name defined through programming with grCreate.
  • the name of Chart control found in the report editor.
PHP Only the interactive Chart controls are available.
<Font used>: Font
Font to use. This parameter corresponds to a variable of type Font. The font characteristics have been defined with FontCreate or via the font properties.

Defining the font used for the chart labels (syntax kept for backward compatibility) Hide the details

grLabelFont(<Chart name> , <Font identifier>)
<Chart name>: Control name or character string
Name of the chart to be used. This name corresponds to:
  • the chart name defined through programming with grCreate.
  • the name of Chart control found in the report editor.
PHP Only the interactive Chart controls are available.
<Font identifier>: Integer
Font identifier, defined by grCreateFont. A WLanguage error occurs if this font does not exist.
Remarks

Handling the category labels

The category labels are displayed:
  • below the horizontal marks for Line and Stock charts (Candlestick and BarCharts),
  • below the X-axis for Column and MinMax charts.
Category label
Category labels cannot be used in Scatter charts.
The category labels are defined by grCategoryLabel.
The label font can be modified by grLabelFont.
The category labels defined by grCategoryLabel can be displayed in the caption of the Pie chart (grShowLabel constant used with grLabel).

Initializing fonts

The default font used for the labels has the following characteristics:
  • Font name: Arial
  • Size: 14
  • Style: Normal
  • Color: Black
When grCreate is used, the default font is used for the labels.

Orientation of the font

For the labels of a chart, the "orientation" property of the font is ignored.
To change the orientation of the font in the labels, the description of the Chart control must be modified in the 7-tab window.
By default, the orientation is automatically chosen. This orientation takes into account the size and the number of labels to display.
Related Examples:
The Chart functions Unit examples (WEBDEV): The Chart functions
[ + ] This example presents the main features of the chart designer of WEBDEV and it allows you to:
- Create a chart: Pie, Column or Line
- Define the display area of a chart
- Define the options of the chart (legend, percentage, ...)
The Chart functions Unit examples (WINDEV Mobile): The Chart functions
[ + ] Using the Chart functions:
- create a Pie, Column or Line chart by programming
- define the chart options (legend, percentage, ...)
Component: wd300grf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help