ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeMap control
  • Overview
  • Initializing a TreeMap control
  • Handling a TreeMap control associated with a Table control
  • Overview
  • Displaying in the TreeMap control the element selected in the Table control
  • Displaying in the Table control the element selected in the TreeMap control
  • Displaying in the TreeMap control the group selected in the Table control
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
Overview
WINDEV allows you handle a TreeMap control through programming. To do so, use the variable of the TreeMap control in the code.
The variable of the TreeMap control corresponds to the name of the TreeMap control.
The TreeMap control can be handled through programming via:
Remark: You also have the ability to handle an element found in a TreeMap control through programming.
Initializing a TreeMap control
To initialize a TreeMap control, all you have to do is describe all the elements with TreeMapAdd.
Remark: A TreeMap control can be populated programmatically with:
  • records from a data file,
  • elements from a Table control, ...
Example:
// Fill a TreeMap control from a Table control based on a data file
Path is string
TreeMapDeleteAll(TMAP_Wine)
FOR I = 1 _TO_ TABLE_Wine.Count
Path  = TABLE_Wine.COL_WineType[I] + "\" + TABLE_Wine.COL_Owner[I]
SWITCH TABLE_Wine.COL_WineType[I]
CASE "RED"
TreeMapAdd(TMAP_Wine, Path, TABLE_Wine.COL_Price[I], LightRed)
CASE "WHITE"
TreeMapAdd(TMAP_Wine, Path, TABLE_Wine.COL_Price[I], White)
CASE "ROSÉ"
TreeMapAdd(TMAP_Wine, Path, TABLE_Wine.COL_Price[I], PastelRed)
END
END
Handling a TreeMap control associated with a Table control

Overview

When a TreeMap control visually displays the elements found in a Table control, it may be useful to allow interactions between the two controls. For example:
  • select in the TreeMap control the element selected in the Table control (and conversely).
  • select in the TreeMap control the group selected in the Table control.
Let's see some examples of operations that can be performed.

Displaying in the TreeMap control the element selected in the Table control

To display in the TreeMap control the element selected in the Table control, all you have to do is use TreeMapSeek.
Example:
SelectionPath is string
SelectionPath = COL_WineType[TABLE_WINE] + "\" + COL_Owner[TABLE_WINE]
TMAP_Wine = TreeMapSeek(TMAP_Wine, SelectionPath)

Displaying in the Table control the element selected in the TreeMap control

To display in the Table control the element selected in the TreeMap control, all you have to do is use TableSearch.
Example: This code can be entered in the selection code of an element found in the TreeMap control:
Path is string
Path = TMAP_Wine[TMAP_Wine]
Path = ExtractString(Path, 2, "\")
RowIndex is int = TableSearch(COL_Owner, Path)
TableSelectPlus(TABLE_WINE, RowIndex)

Displaying in the TreeMap control the group selected in the Table control

To display in the TreeMap control the group of elements selected in the Table control, all you have to do is use TreeMapSelectGroup.
Example:
SelectionGroup is string
SelectionGroup = COL_WineType[TABLE_WINE]
TreeMapSelectGroup(TMAP_Wine, SelectionGroup)
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 01/23/2023

Send a report | Local help