ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Chart functions
  • Tooltip options to configure
  • Enabling/Disabling the tooltip
  • Formatting the elements displayed in the tooltip
  • Customizable tooltip via an internal window
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Displays and formats:
  • the tooltip associated with each graph section (sector for a Pie chart, bar for a Bar chart, etc.). This function also gets the characteristics of the tooltip associated with each section of the chart.
  • a custom tooltip, associated with a point.
By default, a tooltip is automatically displayed (grShowTooltip set to True) when a chart is hovered by the mouse cursor.
Example
// Champ Graphe
// Affichage des pourcentages sur un histogramme
GRF_MonGraphe.Libellé(grShowPercent, True)
GRF_MonGraphe.Bulle(grTooltipFormat, -%"[%SERIE%]" + CR + -%"[%CATEGORIE%]" + CR + -%"[%VALEUR%]")
GRF_MonGraphe.Bulle(grShowTooltip, True)
// Dessin du graphe dans le champ
GRF_MonGraphe.Dessine()
// Champ Graphe
// Affichage d'une bulle spécifique pour un point
GRF_MonGraphe.Bulle(1, 2, "Le contenu de ma bulle d'aide")
// Dessin du graphe dans le champ
GRF_MonGraphe.Dessine()
Syntax

Displaying and formatting the tooltip associated with a Chart control Hide the details

<Chart control>.Tooltip(<Tooltip option to configure> , <Tooltip option value>)
<Chart control>: Control name
Name of the Chart control to use (in the window editor).
<Tooltip option to configure>: Integer constant
Enables or disables the tooltip and configures its characteristics.
New in version 2025
grFormatBubbleInternalWindow
Name of the internal window used to display a custom bubble.
grShowTooltipEnables or disables the tooltip.
grTooltipFormatDefines the tooltip format.
grTooltipFormatBubbleChartDefines the tooltip format in a Bubble chart.
Android This constant is not available.
grTooltipFormatCrosshairHeaderDefines the format of the chart crosshair header.
grTooltipFormatHeatMapDefines the tooltip format in a Heatmap chart.
Android This constant is not available.
grTooltipFormatPieDefines the tooltip format in a Pie chart.
grTooltipFormatRangeAreaDefines the tooltip format in a Range Area chart.
grTooltipFormatScatterDefines the tooltip format in a Scatter chart.
Android This constant is not available.
grTooltipFormatStockDefines the tooltip format in a Stock chart.
Android This constant is not available.
grTooltipFormatWaffleDefines the tooltip format in a Waffle chart.
<Tooltip option value>: Character string or boolean
Value of the selected tooltip option. This value depends on the selected option (see the above table).

Getting the characteristics of the tooltip associated with a Chart control Hide the details

<Result> = <Chart control>.Tooltip(<Tooltip option>)
<Result>: Type corresponding to the option (boolean or character string)
Value of the search option.
<Chart control>: Control name
Name of the Chart control to use (in the window editor).
<Tooltip option>: Integer constant
Tooltip option whose value you want to get.
New in version 2025
grFormatBubbleInternalWindow
Name of the internal window used to display a custom bubble.
grShowTooltipEnables or disables the tooltip.
grTooltipFormatDefines the tooltip format.
grTooltipFormatBubbleChartDefines the tooltip format in a Bubble chart.
Android This constant is not available.
grTooltipFormatCrosshairHeaderDefines the format of the chart crosshair header.
grTooltipFormatHeatMapDefines the tooltip format in a Heatmap chart.
Android This constant is not available.
grTooltipFormatPieDefines the tooltip format in a Pie chart.
grTooltipFormatRangeAreaDefines the tooltip format in a Range Area chart.
Android This constant is not available.
grTooltipFormatScatterDefines the tooltip format in a Scatter chart.
Android This constant is not available.
grTooltipFormatStockDefines the tooltip format in a Stock chart.
Android This constant is not available.
grTooltipFormatWaffleDefines the tooltip format in a Waffle chart.

Displaying and customizing the tooltip associated with a point Hide the details

<Chart control>.grTooltip(<Series number> , <Category number> , <Tooltip value>)
<Chart control>: Control name
Name of the Chart control to use (in the window or page editor).
<Series number>: Integer
Number of the series to use.
<Category number>: Integer
Number of the category to use.
<Tooltip value>: Character string
Custom text of the tooltip associated with the point.
Remarks

Tooltip options to configure

ConstantEffectOption value
grShowTooltipEnables or disables the tooltip.Boolean
  • True (default) to activate the tooltip,
  • False to disable the tooltip.
Caution:
  • Tooltip parameters are not reset on display.
  • The constant grBulleActive must be used to activate the bubble, regardless of the bubble's settings.
grTooltipFormatDefines the tooltip format.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%VALUE%]: Displays the value
    Example: "[%VALUE%]"+CR+"[%CATEGORY%]"
The default format is: "[%CATEGORY%]"+RC+"[%SERIES%]"+"="+"[%VALUE%]"
grTooltipFormatStockDefines the tooltip format in a Stock chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%MAX%]: Displays the session's maximum value.
    [%MIN%]: Displays the session's minimum value.
    [%DEBUT%]: Displays the first value of the session.
    [%FIN%]: Displays the session end value.
By default, the format is as follows:
"[%CATEGORY%]"+CR+"Min.=[%MIN%]"+CR+"Max.=[%MAX%]"+CR+"Open=[%OPEN%]"+CR+"Close=[%CLOSE%]"
grTooltipFormatRadialBarDefines the tooltip format in a Radial Bar chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%VALUE%]: Displays the value
    [%%%]: Displays the percentage
    Exemple: "[%VALEUR%]"+RC+"[%CATEGORIE%]"+RC+"[%%%]"
The default format is "[%CATEGORY%]"+RC+"[%VALUE%]"+RC+"[%%%]"
grTooltipFormatCrosshairHeaderDefines the format of the chart crosshair header.Character string
  • Empty string to use the default format.
  • Character string containing the following string:
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
The default format is "[%CATEGORY%]". Stacked histogram graph: You can add the stack total to the tooltip of a stacked histogram using the following syntax:
GRF_MonGraphe.grBulle(grTooltipFormatCrosshairHeader, ...
"[%CATEGORIE%], Somme = [%VALEUR%]")
grTooltipFormatBubbleChartDefines the tooltip format in a Bubble chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%X%]: Displays abscissa (first series)
    [%Y%]: Displays ordinate (second series)
    [%Z%]: Displays the value of the third series.
The default format is: "([%X%];[%Y%]): [%Z%]"+RC+"[%CATEGORY%]"
New in version 2025
grFormatBubbleInternalWindow
Displays the tooltip as an internal windowCharacter string corresponding to the name of the internal window (enclosed in quotation marks) used to customize the bubble associated with the chart.

Characteristics of internal window:
  • The bubble is displayed only. It is not possible to interact with internal window fields.
  • Internal window prototype:
    PROCEDURE MyWindow(FieldGraph is Field,
    IndexSeries is an integer, Index is an integer,
    Value is a real, BallLabel is a string)
Example:
grTooltip(GRF_Ventes, grTooltipFormatInternalWindow, "FI_BullePersonnalisée")
grTooltipFormatScatterDefines the tooltip format in a Scatter chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%X%]: Displays the abscissa.
The default format is "[%X%]"+RC+"[%Y%]"+RC+"[%SERIE%]"+RC+"[%CATEGORIE%]"
grTooltipFormatHeatMapDefines the tooltip format in a Heatmap chart. Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%X%]: Displays abscissa (first series)
    [%Y%]: Displays ordinate (second series)
    [%Z%]: Displays the value of the third series.
The default format is: "([%X%];[%Y%]): [%Z%]"+RC+"[%CATEGORY%]"
grTooltipFormatPieDefines the tooltip format in a Pie chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%SERIE%]: Displays the series label (defined with the <Chart>.SeriesLabel function)..
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%VALUE%]: Displays the value
    [%%%]: Displays the percentage
    Exemple: "[%VALEUR%]"+RC+"[%CATEGORIE%]"+RC+"[%%%]"
The default format is "[%CATEGORY%]"+RC+"[%VALUE%]"+RC+"[%%%]"
grTooltipFormatWaffleDefines the tooltip format in a Waffle chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    [%VALUE%]: Displays the value
    [%%%]: Displays the percentage
    Example: "[%VALUE%]"+CR+"[%CATEGORY%]"+CR+"[%%%]"
The default format is "[%CATEGORY%]"+RC+"[%VALUE%]"+RC+"[%%%]"
grTooltipFormatRangeAreaDefines the tooltip format in a Range Area chart.Character string
  • Empty string to use the default format.
  • Combination of the following strings:
    [%DEBUT%]: Displays interval start value.
    [%FIN%]: Displays end of interval value.
    [%CATEGORY%]: Displays the category label (defined with the <Chart>.CategoryLabel function)..
    Example: "[%OPEN%]"+CR+"[%CLOSE%]"+CR+"[%CATEGORY%]"
The default format is: "[%DEBUT%]"+RC+"[%FIN%]

If the default format is used:Warning: A compilation error may occur If you use dynamic string construction (option "Allow "[% %]" in strings" in the "Compilation" tab of the project description), a compilation error may appear (unknown identifier). In this case, each string must be preceded by '-%'. Example:
GRF_Echéance.Bulle(grTooltipFormat, "[%CATEGORIE%]" + CR + CR+ "[%VALEUR%]" + " H")
becomes
GRF_Echéance.Bulle(grTooltipFormat, -%"[%CATEGORIE%]" + CR + CR + -%"[%VALEUR%]" + " H")

Enabling/Disabling the tooltip

The tooltip activation/deactivation (grShowTooltip constant) takes effect only when <Chart>.Draw is executed.

Formatting the elements displayed in the tooltip

To format the values displayed in the tooltip (value and percentage), use <Chart>.Mask.
New in version 2025
AndroidiPhone/iPad

Customizable tooltip via an internal window

The function <Chart>.Tooltip used with the constant grFormatBubbleInternalWindow is used to specify the internal window used to display the tooltip for a Chart control.
This internal window is for display only. No interaction between user and bubble possible.
This internal window uses the following prototype:
PROCEDURE MyWindow(FieldGraph is Field,
IndexSeries is an integer, IndexValue is an integer, Value is a real, LabelBubble is a string)
where:
  • ChartControl: Name of the Chart control used.
  • SeriesIndex: Index of the series corresponding to the point hovered over.
  • Index: Index of the point value overflown.
  • Value: Value of the point hovered over.
  • BubbleLabel: Label of the bubble normally displayed. This label can be formatted using the function <Chart>.Tooltip used with the constant grFormatBulle.
Characteristics of internal window:
  • Fields in the internal window cannot be manipulated by the user.
  • The opacity defined for fields in the internal window is taken into account.
  • The size of the internal window used for the tooltip automatically adapts to the content when displayed.
Special cases:
  • In the case of a multi-series crosshairs, the series index and value correspond to the point closest to the mouse. In this case, the "Index" parameter is identical for all points.
    For Stock chart, Bubble chart, Heatmap and Range Area chart types, a single value is returned.
  • In the internal window code, it is possible to retrieve data from other series using the <Chart>.GetData function. For example:
// Retrieve previous value
FieldGraph.retrieveData(NumSeries, Indice-1)
It is also possible to retrieve information such as the legend or color of the series using the properties available in the Chart control.
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.
Component: wd300grf.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/20/2025

Send a report | Local help