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
  • Marks on axes
  • Types of charts
  • Restoring the default values
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Modifies the start and end marks on one of the chart axes.
Note: The grOrigin function allows you to view only part of the graph, by reducing the values displayed on one of the axes.
Linux Caution: Using this function under Linux requires a specific configuration.. For more details, see The charts.
Example
// Modification de la graduation de début et de fin sur l'axe horizontal
// du graphe "MonGraphe". La graduation ira de 5 à 12.
grOrigin("MonGraphe", 5, 12, grXCoordinate)
grDraw("MonGraphe")
// Modification de la graduation de début et de fin sur l'axe vertical du champ Graphe "GRF_Graphe"
// La graduation ira de 500 à 1000
// Restauration des valeurs par défaut

// Initialisation de fenêtre
gnYMin is int
gnYmax is int

// Bouton de modification de la graduation
gnYMin = GRF_Graphe..YAxisMin
gnYmax = GRF_Graphe..YAxisMax
grOrigin(GRF_Graphe, 500, 1000, grYCoordinate)
grDraw(GRF_Graphe)

// Bouton de restauration de la graduation
grOrigin(GRF_Graphe, gnYMin, gnYmax, grYCoordinate)
grDraw(GRF_Graphe)
Syntax
grOrigin(<Chart name> , <Minimum mark> [, <Maximum mark> [, <Type of axis>]])
<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.
  • the name of the Chart control in the window, page or report editor.
Android Only Chart controls are available.
PHP Only interactive Chart controls are available.
<Minimum mark>: Real
Start mark on the specified axis.
This parameter can also correspond to a duration, a date, a time or a date-time.
<Maximum mark>: Optional real
End mark on the specified axis. If this parameter is not specified, <Maximum mark> corresponds to the maximum value of chart data.
This parameter can also correspond to a duration, a date, a time or a date-time.
<Type of axis>: Optional constant
Axis for which the marks must be modified:
grSecondaryYCoordinateSecondary Y-axis (vertical axis).
grXCoordinate
(default value)
X-axis (horizontal axis).
grYCoordinateY-axis (vertical axis).
grZCoordinateZ-axis (Surface charts only).
Android This constant is not available.
Remarks

Marks on axes

  • X-axis (horizontal axis): the parameters <Graduation minimale> and <Graduation maximale> correspond to the minimum and maximum index of data in the series displayed.
  • Y-axis (vertical axis): the parameters <Graduation minimale> and <Graduation maximale> correspond to the minimum and maximum values of the data.
  • Limits: 100 graduations above and 100 graduations below the x-axis.
  • To modify the frequency of marks on the horizontal or vertical axis of a chart, use grInterval.
  • The data defined by grOrigin will be taken into account during the next call to grDraw.

Types of charts

The marks on axes have no effect on the Pie charts.

Restoring the default values

To restore the display of the chart before the origin was modified, the minimum and maximum values of axes must be saved. These values can be known via the following properties:
XAxisMaxThe XAxisMax property gets the maximum value of the X-axis in a Chart control. This property can be used in the "Zoom" event of a Chart control to identify the section displayed.
XAxisMinThe XAxisMin property gets the minimum value of the X-axis in a Chart control. This property can be used in the "Zoom" event of a Chart control to identify the section displayed.
YAxisMaxThe YAxisMax property gets the maximum value of the Y-axis in a Chart control. This property can be used in the "Zoom" event of a Chart control to identify the section displayed.
YAxisMinThe YAxisMin property gets the minimum value of the Y-axis in a Chart control.
ZAxisMaxThe ZAxisMax property gets the maximum value of the Z-axis in a Chart control (Surface chart).
ZAxisMinThe ZAxisMin property gets the minimum value of the Z-axis in a Chart control (Surface chart).
WINDEVAndroidiPhone/iPadIOS WidgetMac Catalyst Note: the grZoom function can also be used to display part of the graph.. However, the final user can restore the initial configuration via the context menu of the chart ("Initial zoom").
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
Component: wd300grf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help