ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • Chart legend
  • Manual positioning of legend: grLegend without effect
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
Indicates the presence and position of legend in a chart.
Example of legend in a chart:
Legend in a chart
Remark: The legend contains the colors and the series labels (or section labels) of a chart.
Linux Caution: A specific configuration is required to use this function in Linux. For more details, see The charts.
Example
// Chart created through programming
grCreate("MyChart", grColumn)
grDestinationWnd("MyChart", "", "Title of the window")
// The legend is displayed on the right of "MyChart"
grLegend("MyChart", grAtRight)
...
grDraw("MyChart")
// Using a Chart control
// The legend is displayed on the left of CHART_MyChart
grLegend(CHART_MyChart, grAtLeft)
...
grDraw(CHART_MyChart)
Syntax
grLegend(<Chart name> , <Position>)
<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 the Chart control in the window, page or report editor.
Android Only Chart controls are available.
PHP Only the interactive Chart controls are available.
<Position>: Integer
Position of chart legend:
grAtBottomLegend displayed below the chart.
grAtLeftLegend displayed on the left of chart.
grAtRightLegend displayed on the right of chart.
grAtTopChart legend displayed above the chart.
grNoneNo legend.
Remarks

Chart legend

The set of series labels correspond to the chart legend.
Labels of series
Series labels cannot be used in Pie charts.
Series labels are defined with grSeriesLabel.
The legend font can be changed with grLegendFont.
grLegend indicates the presence and position of the legend (i. e. all series labels). The modifications performed by grLegend will be taken into account during the next call to grDraw. You can change the position of the chart legend via a context menu.
Remark: To define series labels in "Scatter" charts, we recommend that you use grScatterSeriesLabel. For more details, see Legends of a chart.

Manual positioning of legend: grLegend without effect

grLegend has no effect if the legend is positioned manually ("Manual positioning" in the chart legend window).
Related Examples:
The Chart functions Unit examples (WINDEV): The Chart functions
[ + ] Using the main chart designer features of WINDEV:
- Create a Pie, Column or Line chart
- Define the display area of a chart
- Define the chart options (legend, percentage, ...)
- Draw a line on a chart
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.
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: wd290grf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/27/2023

Send a report | Local help