AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Gráfico
  • Overview
  • Chart populated programmatically
  • Remarks
  • Special case
  • Chart control in a window or in a page based on a Table control built by BuildBrowsingTable
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
The data that will be displayed in the Chart control can come from:
  • a data file item 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 programmatically.
  • 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 control description window ("Series" tab).
Chart populated programmatically
The programming required to fill the chart is performed by the following functions:
grAddDataAdds a data into a chart.
grHMAddDataAgrega un dato a un gráfico de Heatmap.
grIncreaseDataAñade un valor a un dato de un gráfico.
grScatterAddDataXYAdds a data into a "Scatter" chart.
grStockAddDataAdds data into a stock chart (candlestick, barcharts or minmax).
grSunburstAddDataAdds a data to a Sunburst chart.
grSurfaceAddDataAdds 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 "Initialization" 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 state:
    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 "Before printing" event of the Body block:
    // Add data into the chart
    grAddData(CHART_MyChart, 1, MySource.Turnover)

Remarks

Special case
WINDEV

Chart control in a window or in a page based on a Table control built by BuildBrowsingTable

If you are creating a new chart whose source is a Table control filled by BuildBrowsingTable from a query, you must specify that the columns correspond to _COL1, _COL2, ...
You can also use grSourceSeries to modify the source of the series.
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 13/03/2025

Señalar un error o enviar una sugerencia | Ayuda local