PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Chart filled by programming
  • Notes
  • Special case
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The data that will be displayed in the Chart control can come from:
  • an item of a data file or a query.
  • a column of a Table control found in the current window or page.
  • a List Box control found in the current window or page.
  • a WLanguage array.
  • data specified in the description window of the control or by programming.
  • a control of the current report (only for a report).
The mode for filling the chart is specified in the wizard for control creation and in the description window of control ("Series" tab).
Chart filled by programming
The programming required to fill the chart is performed by the following functions:
Versions 09 and later
grAddData
New in version 09
grAddData
grAddData
Adds a data into a chart.
Versions 21 and later
grHMAddData
New in version 21
grHMAddData
grHMAddData
Adds a data into a Heatmap chart.
Versions 09 and later
grIncreaseData
New in version 09
grIncreaseData
grIncreaseData
Adds a value to a data in a chart.
Versions 09 and later
grScatterAddDataXY
New in version 09
grScatterAddDataXY
grScatterAddDataXY
Adds a data into a "Scatter" chart.
Versions 09 and later
grStockAddData
New in version 09
grStockAddData
grStockAddData
Adds data into a stock chart (candlestick, barcharts or minmax).
Versions 20 and later
grSunburstAddData
New in version 20
grSunburstAddData
grSunburstAddData
Adds a data to a Sunburst chart.
Versions 18 and later
grSurfaceAddData
New in version 18
grSurfaceAddData
grSurfaceAddData
Adds a data into a Surface chart.
For example:
  • Chart control in a window or page:
    The "CHART_MySalary" Chart control is used to view the evolution of a salary over the last four years in a Line chart.
    The "EDT_Salary1", "EDT_Salary2", "EDT_Salary3" and "EDT_Salary4" edit controls are used to type the salary for the corresponding year.
    In this example, write the following code in the "Initializing" event of the Chart control:
    // Add data into the chart
    grAddData(CHART_MySalary, 1, EDT_Salary1)
    grAddData(CHART_MySalary, 1, EDT_Salary2)
    grAddData(CHART_MySalary, 1, EDT_Salary3)
    grAddData(CHART_MySalary, 1, EDT_Salary4)
  • Chart control in a report:
    The "RPT_MyReport" report prints the details (last name, first name, turnover) of the 10 best customers.
    The "CHART_MyChart" chart displays the turnover of each customer in a pie chart.
    In this example, write the following code in the event "Before printing" of the Body block:
    // Add data into the chart
    grAddData(CHART_MyChart, 1, MySource.Turnover)

Notes

Special case
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment