- Adding data
- Adding data into the different types of charts
grAddData (Function) In french: grAjouteDonnée
// Add a data into the "CHART_MyChart" control. // This data (whose value is 10) is added at the end of the first series. grAddData(CHART_MyChart, 1, 10)
Syntax
grAddData(<Chart name> , <Series number> [, <Subscript>] , <Value>)
<Chart name>: Control name or character string (with quotes) Name of chart to use. This name corresponds to:- the chart name defined by programming with grCreate. This name must be in quotation marks.
- the name of Chart control (found in the window editor, page editor or report editor). This name must not be in quotation marks.
<Series number>: Integer Number of the series into which a value will be added. For example, if the Chart control displays 2 lines, this is used to identify the line for which the data must be added. If the specified number does not exist, the series between the last existing series and the specified number are automatically created and initialized to 0. <Subscript>: Optional integer Subscript of the data in the series into which a value must be added. For example, for a Line chart, this parameter corresponds to the X-axis of the value to add. If this parameter: - is not specified, the value is added at the end of the series.
- is specified, the former value is replaced.
<Value>: Integer or real Value to add. For example, for a Line chart, this parameter corresponds to the Y-axis of the value to add. Remarks Adding data - The data added by grAddData will be taken into account during the next call to grDraw.
- For a pie chart (grPie constant), only the data found in the first series is used. A Pie chart cannot be drawn if the data found in the first series is null.
- For the "Stacked bar" charts, if the value of the first series is negative, the corresponding bar is oriented toward the bottom.
Adding data into the different types of charts - For the Scatter charts, we recommend that you use grScatterAddDataXY.
- For the stock charts, we recommend that you use grStockAddData.
Versions 21 and laterFor the Heatmap charts, we recommend that you use grHMAddData. New in version 21For the Heatmap charts, we recommend that you use grHMAddData. For the Heatmap charts, we recommend that you use grHMAddData. Versions 20 and laterFor the Sunburst charts, we recommend that you use grSunburstAddData. New in version 20For the Sunburst charts, we recommend that you use grSunburstAddData. For the Sunburst charts, we recommend that you use grSunburstAddData. Versions 18 and laterFor the Surface charts, we recommend that you use grSurfaceAddData. New in version 18For the Surface charts, we recommend that you use grSurfaceAddData. For the Surface charts, we recommend that you use grSurfaceAddData.- To add a value to a chart data, use grIncreaseData.
Related Examples:
|
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.
|
|
Unit examples (WEBDEV): The Chart functions
[ + ] This example presents the main features of the chart designer of WEBDEV and it allows you to: - Create a chart: Pie, Column or Line - Define the display area of a chart - Define the options of the chart (legend, percentage, ...)
|
|
Unit examples (WINDEV Mobile): The Chart control
[ + ] Using the Chart control to display different types of charts: - Pie (or pie chart) - Line - Column chart - Area
|
|
Unit examples (WINDEV Mobile): The Chart functions
[ + ] Using the Chart functions: - create a Pie, Column or Line chart by programming - define the chart options (legend, percentage, ...)
|
Business / UI classification : Neutral code
This page is also available for…
|
|
|