ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • Adding data
  • Adding data into the different types of charts
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a data into a chart.
Attention: For "advanced" graph types, there's a specific WLanguage function for adding data (see paragraph "Remarks")..
WEBDEV - Server codeLinux Caution: Using this function under Linux requires a specific configuration.. For more details, see The charts.
Example
// Ajout d'une donnée dans le champ "GRF_MonGraphe". 
// Cette donnée de valeur 10, est ajoutée à la fin de la première série.
grAddData(GRF_MonGraphe, 1, 10)
// Courbe de 9 valeurs: si l'option "Dessin des valeurs manquantes" correspond à "Non dessinées", 
// seul le point 3 n'est pas dessiné, les points 8 et 9 sont dessinés (à zéro)
grAddData(GRF_MonGraphe, 1, 1, 50)
grAddData(GRF_MonGraphe, 1, 2, 30)
grAddData(GRF_MonGraphe, 1, 3, 30) // pas dessiné
grAddData(GRF_MonGraphe, 1, 4, 30)
grAddData(GRF_MonGraphe, 1, 5, 60)
grAddData(GRF_MonGraphe, 1, 6, 60)
grAddData(GRF_MonGraphe, 1, 7, 0) // dessiné dans tous les cas,
grAddData(GRF_MonGraphe, 1, 8, Null) // dessiné dans tous les cas,
grAddData(GRF_MonGraphe, 1, 9, 60) 

grDraw(GRF_MonGraphe)
Syntax
grAddData(<Chart name> , <Series number> [, <Index>] , <Value>)
<Chart name>: Control name or character string
Name of the chart to be used. This name corresponds to:
  • the name of the chart defined programmatically with grCreate. This name must be in quotation marks.
  • the name of the Chart control (in the window, page or report editor). This name must not be in quotation marks.
Android Only Chart controls are available.
PHP Only interactive Chart controls are available.
<Series number>: Integer
Number of the series into which a value will be added.
For example, if the Chart control displays 2 lines, this is used to identify the line for which the data must be added.
If the specified number does not exist, the series between the last existing series and the specified number are automatically created and initialized to 0.
<Index>: Optional integer
Index of the data in the series into which a value must be added.
For example, for a Line chart, this parameter corresponds to the X-axis of the value to add.
If this parameter:
  • is not specified, the value is added at the end of the series.
  • is specified, the former value is replaced.
Android The index of the data in the series must be a strictly positive integer.
<Value>: Integer or real
Value to add.
For example, for a Line chart, this parameter corresponds to the Y-axis of the value to add.
Remarks

Adding data

  • The data added by grAddData will be taken into account during the next call to grDraw.
  • For a pie chart (grPie constant), only the data found in the first series is used. A Pie chart cannot be drawn if the data found in the first series is null.
  • For the "Stacked bar" charts, if the value of the first series is negative, the corresponding bar is oriented toward the bottom.

Adding data into the different types of charts

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.
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 control Unit examples (WINDEV Mobile): The Chart control
[ + ] Using the Chart control to display different types of charts:
- Pie (or pie chart)
- Line
- Column chart
- Area
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, ...)
Business / UI classification: Neutral code
Component: wd300grf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help