AreaChart
AreaChart ( appearanceConst ; doShiftIntervals )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
appearanceConst | int | 0..127 | default | |
doShiftIntervals | int | 0..1 | off |
Description
The AreaChart() function serves to draw one-dimensional area charts.
| AREA_CHART_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(8 13 9 18 16 8) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#4682b420) |
6 | BorderStyle(1;poly;2.0;#4682b4) |
7 | /* Set up axes. */ |
8 | |
9 | AxisMajorTicks(all;0) |
10 | /* Set up grid. */ |
11 | MajorGridLineWidths(all;all;0.25) |
12 |
| AREA_CHART_02 |
1 | OpenDrawing(250;150) |
2 | ChartData( 8 13 9 18 11 8; /* 1st series. */ |
3 | 12 3 4 11 5 3; /* 2nd series. */ |
4 | 12 3 8 4 16 9) /* 3rd series. */ |
5 | |
6 | /* Set up styles. */ |
7 | |
8 | |
9 | /* Set up axes. */ |
10 | |
11 | AxisMajorTicks(x;5;0.5;#333;;out) |
12 | AxisMajorTicks(y;0) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(x;y;0.25) |
15 | MajorGridLineWidths(y;x;0) |
16 |
The 1st argument appearanceConstants makes it possible to rotate the chart 90 degrees (appearanceConstants = horizontal) and to add symbols (appearanceConstants = symbol), shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) to the areas. All options can be combined arbitrarily by using a plus sign "+".
| AREA_CHART_03 |
1 | OpenDrawing(250;150) |
2 | ChartData(8 13 9 18 16 8) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#4682b420) |
6 | BorderStyle(1;poly;2.0;#4682b4) |
7 | SymbolStyle(1;circle;6;1.5;#4682b4;;white) |
8 | /* Set up axes. */ |
9 | |
10 | AxisMajorTicks(all;0) |
11 | /* Set up grid. */ |
12 | MajorGridLineWidths(all;all;0.25) |
13 |
The fills, borders, symbols and shadows can be varied by using the style functions FillColorScheme() , FillStyle() , PictureStyle() , BorderColorScheme() , BorderStyle() , SymbolColorScheme() , SymbolStyle() and ShadowStyle() and the labels by using the five style functions LabelTexts() , LabelStyle() , LabelBackground() , LabelBackgroundOptions() and LabelOptions() .
| AREA_CHART_04 |
1 | OpenDrawing(250;150) |
2 | ChartData(8 13 10 10 6 8; |
3 | 8 4 4 13 10 12; |
4 | 2 10 18 15 16 18) |
5 | |
6 | /* Set up styles. */ |
7 | FillColorScheme(15;solid;0.1) |
8 | |
9 | BorderStyle(all;poly;1.5) |
10 | /* Set up axes. */ |
11 | |
12 | AxisMajorTicks(all;0) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(x;y;0.25) |
15 | MajorGridLineWidths(y;x;0) |
16 |
| AREA_CHART_05 |
1 | OpenDrawing(250;150) |
2 | ChartData( 8 13 9 18 15 8; /* 1st series. */ |
3 | 14 3 5 11 8 4) /* 2nd series. */ |
4 | |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;2.0;#4682b4) |
8 | SymbolStyle(1;none) |
9 | LabelTexts(1;"") /* Hide labels. */ |
10 | |
11 | BorderStyle(2;step;1;#f15a24) |
12 | SymbolStyle(2;bullet;4;1;#f15a24;shaded) |
13 | /* Set up axes. */ |
14 | |
15 | AxisMajorTicks(all;0) |
16 | /* Set up grid. */ |
17 | MajorGridLineWidths(x;y;0.25) |
18 | MajorGridLineWidths(y;x;0) |
19 |
| AREA_CHART_06 |
1 | OpenDrawing(250;150) |
2 | ChartData( 3 7 10 15 16 18; /* 1st series. */ |
3 | -2 -4 -8 -12 -18 -15) /* 2nd series. */ |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | |
8 | BorderStyle(all;step;0) |
9 | ShadowStyle(all;2 2 5) |
10 | /* Set up axes. */ |
11 | ScalingOptions(y;on) /* y-scaling top to bottom. */ |
12 | |
13 | AxisMajorTicks(x;5;0.5;#333;;out) |
14 | AxisMajorTicks(y;0) |
15 | /* Set up grid. */ |
16 | MajorGridStripeColors(x;y;#f1f1f1;#fafafa) |
17 | MajorGridLineWidths(all;all;0) |
18 |
Furthermore, one-dimensional area charts can be stacked (appearanceConstants = stacked) and drawn proportionally (appearanceConstants = proportional). Proportional charts are automatically stacked. The labeling of stacked charts is explained in combination with the LabelOptions() function.
| AREA_CHART_07 |
1 | OpenDrawing(250;150) |
2 | ChartData(3 7 10 15 16 18; /* 1st series. */ |
3 | 2 4 8 12 18 15) /* 2nd series. */ |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | |
8 | |
9 | /* Set up axes. */ |
10 | |
11 | AxisMajorTicks(x;5;0.25;#333;;out) |
12 | AxisMajorTicks(y;0) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(x;y;0.25) |
15 | MajorGridLineWidths(y;x;0) |
16 | |
17 |
| AREA_CHART_08 |
1 | OpenDrawing(250;150) |
2 | ChartData( 8 13 9 12 11 8; /* 1st series. */ |
3 | 12 13 14 12 9 16) /* 2nd series. */ |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | |
8 | BorderStyle(1;none) |
9 | BorderStyle(2;poly;1;#8a9420) |
10 | ShadowStyle(all;2 2 5) |
11 | /* Set up axes. */ |
12 | |
13 | AxisMajorTicks(x;5;0.25;#333;;out) |
14 | AxisMajorTicks(y;0) |
15 | /* Set up grid. */ |
16 | MajorGridLineWidths(x;y;0.25) |
17 | MajorGridLineWidths(y;x;0) |
18 | |
19 |
| AREA_CHART_09 |
1 | OpenDrawing(250;150) |
2 | ChartData( 8 13 9 18 14 8; /* 1st series. */ |
3 | 12 3 4 11 5 3; /* 2nd series. */ |
4 | 12 3 8 4 16 9) /* 3rd series. */ |
5 | |
6 | /* Set up styles. */ |
7 | FillColorScheme(15;solid;0.7) |
8 | |
9 | /* Set up axes. */ |
10 | |
11 | |
12 | AxisMajorTicks(x;5;0.5;#333;;out) |
13 | AxisMajorTicks(y;0) |
14 | /* Set up grid. */ |
15 | MajorGridLineWidths(x;y;0.5) |
16 | MajorGridLineWidths(y;x;0) |
17 | |
18 |
For one-dimensional charts it is possible to move the polygon points half an interval width so that they do not lie on the interval borders but rather in the middle of the intervals. This can be done by activating the 2nd argument doShiftIntervals = on.
| AREA_CHART_10 |
1 | OpenDrawing(250;150) |
2 | ChartData( 8 13 8 18 11 8; /* 1st series. */ |
3 | -12 3 4 11 5 3; /* 2nd series. */ |
4 | 13 3 -8 4 16 9) /* 3rd series. */ |
5 | |
6 | /* Set up styles. */ |
7 | FillColorScheme(15;solid;0.1) |
8 | |
9 | |
10 | BorderStyle(all;smooth;1.0) /* After BorderColorScheme() */ |
11 | SymbolStyle(all;circle;5;1;;;white) /* After SymbolColorScheme() */ |
12 | /* Set up axes. */ |
13 | |
14 | AxisMajorTicks(x;5;0.25;#333;;out) |
15 | AxisMajorTicks(y;0) |
16 | /* Set up grid. */ |
17 | MajorGridLineWidths(x;y;0.25) |
18 | MajorGridLineWidths(y;x;0) |
19 |