AreaChart2D
AreaChart2D ( appearanceConst ; fillAreaToAxis )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
appearanceConst | int | 0..127 | default | |
fillAreaToAxis | int | 0..2 | 0 |
Examples
AreaChart2D(shadow;1)
Description
The AreaChart2D() function makes it possible to draw two-dimensional area charts. The 1st data series in the ChartData() function provides the x-values, the 2nd data series the y-values for the first area, the 3rd and 4th data series in ChartData() the x and y-values for the second area, etc.
| AREA_CHART_2D_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(7 11 18 20 24 7; /* x-values. */ |
3 | 2 18 16 4 13 2) /* y-values. */ |
4 | |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;2.0;#4682b4) |
8 | /* Set up axes. */ |
9 | |
10 | AxisMajorTicks(all;0) |
11 | /* Set up grid. */ |
12 | MajorGridLineWidths(all;all;0.25) |
13 | |
14 |
As for one-dimensional area charts, symbols (appearanceConstants = symbol), shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) can also be added to the areas by using the argument appearanceConstants. The options can be combined arbitrarily by using a plus sign " +". Rotating (appearanceConstants = horizontal) is not supported for two-dimensional charts as this is simply possible by switching the data series in ChartData() .
| AREA_CHART_2D_02 |
1 | OpenDrawing(250;150) |
2 | ChartData(7 11 18 20 24 7; /* x-values. */ |
3 | 2 18 16 4 13 2) /* y-values. */ |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | BorderStyle(1;poly;1;#8a9420) |
8 | SymbolStyle(1;circle;5;1;#8a9420;;white) |
9 | ShadowStyle(1;2 2 5) |
10 | /* Set up axes. */ |
11 | |
12 | AxisMajorTicks(all;0) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(all;all;0.25) |
15 | |
16 |
| AREA_CHART_2D_03 |
1 | OpenDrawing(250;150) |
2 | ChartData( 7 11 18 20 24; /* 1st series: x-values. */ |
3 | 10 18 16 7 13; /* 1st series: y-values. */ |
4 | 17 10 13 12 17; /* 2nd series: x-values. */ |
5 | 6 10 15 2 6) /* 2nd series: y-values. */ |
6 | |
7 | /* Set up styles. */ |
8 | |
9 | FillStyle(2;#4682b420) |
10 | BorderStyle(1;poly;1.5;darkRed) |
11 | BorderStyle(2;smooth;1;#4682b4) |
12 | SymbolStyle(1;none) |
13 | SymbolStyle(2;circle;5;1;#4682b4;;white) |
14 | /* Set up axes. */ |
15 | |
16 | AxisMajorTicks(all;0) |
17 | /* Set up grid. */ |
18 | MajorGridLineWidths(all;all;0.25) |
19 | |
20 |
By using the 2nd argument fillAreaToAxis, it is possible to extend the fill to the x-axis and/or y-axis. The following three options are available:
- fillAreaToAxis = 0: no fill to the axis (default)
- fillAreaToAxis = 1: fill to the x-axis
- fillAreaToAxis = 2: fill to the y-axis
| AREA_CHART_2D_04 |
1 | OpenDrawing(250;150) |
2 | ChartData( 7 9 18 19 24; /* x-values. */ |
3 | 10 18 14 7 13) /* y-values. */ |
4 | AreaChart2D(;1) |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;1.5;#4682b4) |
8 | /* Set up axes. */ |
9 | |
10 | AxisMajorTicks(all;0) |
11 | /* Set up grid. */ |
12 | MajorGridLineWidths(all;all;0.25) |
13 | |
14 |
| AREA_CHART_2D_05 |
1 | OpenDrawing(250;150) |
2 | ChartData(3 17 14 19 21 11; /* x-values. */ |
3 | 2 7 11 13 16 18) /* y-values. */ |
4 | AreaChart2D(symbol;2) |
5 | AreaChartOptions(on) /* After AreaChart2D() */ |
6 | /* Set up styles. */ |
7 | FillStyle(1;#4682b420) |
8 | BorderStyle(1;poly;0.5;#4682b4) |
9 | LineStyle(1;;1.5;#4682b4) |
10 | SymbolStyle(1;circle;5;1;#4682b4;;white) |
11 | /* Set up axes. */ |
12 | |
13 | AxisMajorTicks(all;0) |
14 | /* Set up grid. */ |
15 | MajorGridLineWidths(all;all;0.25) |
16 | |
17 |