Scaling
Scaling ( axisIndex ; type ; minValue ; maxValue ; numOfMajorIntervals ; numOfMinorIntervals ; logBaseValue ; useEquidistantLogScaling )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
axisIndex | int | 0..10000 | all | |
type | int | 1..3 | linear | |
minValue | num | -inf..+inf | (autom.) | |
maxValue | num | -inf..+inf | (autom.) | |
numOfMajorIntervals | int | -18..1000 | (autom.) | |
numOfMinorIntervals | int | -18..1000 | 1 | |
logBaseValue | num | 1.0001..inf | 10 | |
useEquidistantLogScaling | int | 0..1 | off |
Examples
Description
The type of scaling as well as the number of subdivisions and the scaling range can be defined by using the function Scaling(). If no scaling function is used, a suitable linear scaling is automatically computed. The 2nd argument type makes it possible to choose between linear (type = linear), percent (type = percent) and logarithmic scaling (type = log). If no type is defined, then linear scaling is used.
| SCALING_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 15 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | |
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 |
| SCALING_02 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 15 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | |
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 |
| SCALING_03 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 15 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | |
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 |
By using the 3rd and 4th argument, a minimum and maximum scaling value can be defined. Dates and/or times can also be used as the minimum and maximum value (time axis). If the minimum or maximum value is not defined, a suitable value is automatically sought. The number of major and minor intervals can be controlled by using the 5th and 6th argument. The number of minor intervals applies to the number of intervals within a major interval, e.g. if the major intervals are to be subdivided into 5 minor intervals, numOfMinorIntervals = 5 should be set; if no minor tick marks are to be used, numOfMinorIntervals = 1 (default) should be set. If no major interval is defined, the scaling is subdivided into 4 major intervals as the default.
| SCALING_04 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 25 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | Scaling(y;linear;0;30;3;5) /* 3 major and 5 minor intervals. */ |
12 | |
13 | AxisMajorTicks(x;5;0.5;#333;;out) |
14 | AxisMajorTicks(y;0) |
15 | AxisMinorTicks(y;0) |
16 | /* Set up grid. */ |
17 | MajorGridLineWidths(y;x;0) |
18 | MajorGridLineWidths(x;y;0.5) |
19 | MinorGridLineWidths(x;y;0.5) |
20 |
| SCALING_05 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 15 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | |
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 |
| SCALING_06 |
1 | OpenDrawing(250;150) |
2 | ChartData(16 18 15 17 13 8) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;17;1.25;darkRed;;white) |
7 | LabelStyle(1;Verdana;9) |
8 | LabelOptions(1;centerCenter;;-1) |
9 | ShadowStyle(1;2 2 3) |
10 | /* Set up axes. */ |
11 | Scaling(y;log;5;20;3;5) /* 3 major and 5 minor intervals. */ |
12 | |
13 | AxisMajorTicks(x;5;0.25;#333;;out) |
14 | AxisMajorTicks(y;0) |
15 | AxisMinorTicks(y;0) |
16 | /* Set up grid. */ |
17 | MajorGridLineWidths(y;x;0) |
18 | MajorGridLineWidths(x;y;0.5) |
19 | MinorGridLineWidths(x;y;0.5) |
20 |
| SCALING_07 |
1 | OpenDrawing(160;160) |
2 | ChartData(17 24 15 17 13) |
3 | |
4 | RadarChartOptions(1;poly) /* After RadarChart() */ |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;1.5;#4682b4) |
8 | /* Set up axes. */ |
9 | |
10 | ScalingOptions(all;;;on) /* Hide "0" scaling label. */ |
11 | |
12 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
13 | AxisLabelText(all;"A";"B";"C";"D";"E") |
14 | /* Set up grid. */ |
15 | MajorGridLineColors(all;all;#d0d0d0) |
16 |
Dates and/or times can also be used as the minimum and maximum value (time axis). Additional information can be found in Date & Time.
| SCALING_08 |
1 | OpenDrawing(250;150) |
2 | ChartData(2024-08-15 2024-08-24) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#4682b420) |
6 | BorderStyle(1;;1.5;#4682b4) |
7 | /* Set up axes. */ |
8 | |
9 | |
10 | AxisMajorTicks(all;0) |
11 | AxisMajorTickLabelStyle(x;;;;;;-90) |
12 | AxisMajorTickLabelOptions(x;;;3) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(all;all;0.25) |
15 |
| SCALING_09 |
1 | OpenDrawing(250;100) |
2 | ChartData(2022-05-22 2024-06-14) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#4682b420) |
6 | BorderStyle(1;;1.5;#4682b4) |
7 | Labeltexts(1;"|u| days") |
8 | /* Set up axes. */ |
9 | |
10 | |
11 | AxisMajorTicks(all;0) |
12 | AxisMinorTicks(all;0) |
13 | AxisMajorTickLabelTexts(x;"|YYYY|") |
14 | /* Set up grid. */ |
15 | MajorGridLineWidths(all;all;0.5) |
16 | MinorGridLineWidths(y;x;0.5) |
17 |
In the event of a time axis, major and minor intervals can be defined by scaling constants.
| SCALING_10 |
1 | OpenDrawing(250;100) |
2 | DateTimeOptions(ymd;2) |
3 | ChartData(2024-08-14 2024-08-22 2024-08-27<amp/>12:00; |
4 | 19 28 23) |
5 | AreaChart2D(;1) |
6 | /* Set up styles. */ |
7 | FillStyle(1;#4682b420) |
8 | BorderStyle(1;;1.5;#4682b4) |
9 | /* Set up axes. */ |
10 | |
11 | |
12 | AxisMajorTicks(all;0) |
13 | AxisMajorTickLabelTexts(x;"Week #|WY|") |
14 | /* Set up grid. */ |
15 | MajorGridLineWidths(all;all;0.25) |
16 |
| SCALING_11 |
1 | OpenDrawing(300;120) |
2 | DateTimeOptions(ymd;2) |
3 | ChartData(2024-08-10 2024-08-22 2024-08-25 2024-08-27) |
4 | |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;;1.5;#4682b4) |
8 | /* Set up axes. */ |
9 | |
10 | |
11 | AxisMajorTicks(all;0) |
12 | AxisMinorTicks(all;0) |
13 | AxisMajorTickLabelTexts(x;"WK |WY|") |
14 | AxisMajorTickLabelOptions(x;out;;35) |
15 | AxisMinorTickLabelTexts(x;"|M/D|") |
16 | AxisMinorTickLabelStyle(x;;;;;;-90) |
17 | AxisMinorTickLabelOptions(x;;;3) |
18 | /* Set up grid. */ |
19 | MajorGridLineWidths(all;all;0.5) |
20 | MinorGridLineWidths(y;x;0.5) |
21 |
| SCALING_12 |
1 | OpenDrawing(250;120) |
2 | DateTimeOptions(ymd;2) |
3 | ChartData(2024-06-21 2024-8-22 2024-9-27; |
4 | 19 28 23) |
5 | AreaChart2D(;1) |
6 | /* Set up styles. */ |
7 | FillStyle(1;#4682b420) |
8 | BorderStyle(1;;1.5;#4682b4) |
9 | /* Set up axes. */ |
10 | |
11 | |
12 | AxisMajorTicks(all;0) |
13 | AxisMinorTicks(all;0) |
14 | AxisMajorTickLabelTexts(x;"|Mon|") |
15 | |
16 | AxisMinorTickLabelTexts(x;"WK |WY|";"") |
17 | AxisMinorTickLabelStyle(x;;;;;;-90) |
18 | AxisMinorTickLabelOptions(x;;;3) |
19 | /* Set up grid. */ |
20 | MajorGridLineWidths(all;all;1 2 2) |
21 | MinorGridLineWidths(y;x;0.5) |
22 | |
23 |
| SCALING_13 |
1 | OpenDrawing(300;150) |
2 | ChartData(11:30 16:15; |
3 | 9:30 12:00 13:30 16:50; |
4 | 10:15 15:30) |
5 | GanttChart(label;75) |
6 | /* Set up styles. */ |
7 | FillStyle(1;#4682b420) |
8 | FillStyle(2;#daa52020) |
9 | FillStyle(3;#6b8e2320) |
10 | BorderStyle(1;;1.5;#4682b4) |
11 | BorderStyle(2;;1.5;#daa520) |
12 | BorderStyle(3;;1.5;#6b8e23) |
13 | /* Set up axes. */ |
14 | |
15 | ScalingOptions(y;on) /* y-scale top to bottom. */ |
16 | |
17 | AxisMajorTicks(all;0) |
18 | AxisMinorTicks(all;0) |
19 | AxisMajorTickLabelTexts(x;"|h:mm|") |
20 | AxisMajorTickLabelStyle(x;;;;;;-90) |
21 | AxisMajorTickLabelOptions(x;;;3) |
22 | /* Set up grid. */ |
23 | MajorGridLineWidths(all;all;0.25) |
24 | MinorGridLineWidths(y;x;0.25) |
25 | |
26 |
The arguments logBaseValue and useEquidistantLogScaling are solely used for logarithmic scaling. The base of the logarithm is defined by using the argument logBaseValue. If no base is defined, the decimal logarithm (logBaseValue = 10) is used for scaling. By activating the argument useEquidistantLogScaling = on, only scaling values, which are a multiple of the base, are used; for example, for a logarithmic scaling with a base of 10, only values such as 0.01, 0.1, 1, 10, 100, 1000, etc. are used.
| SCALING_14 |
1 | OpenDrawing(250;150) |
2 | ChartData(36 18 14 18 13 8 5) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;5;1;darkRed;;white) |
7 | /* Set up axes. */ |
8 | |
9 | |
10 | AxisMajorTicks(x;5;1;#333;;out) |
11 | AxisMajorTicks(y;0) |
12 | AxisMinorTicks(all;0) |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(y;x;0) /* Hide vertical grid lines. */ |
15 | MajorGridLineWidths(x;y;1) |
16 | MinorGridLineWidths(x;y;0.75) |
17 |
| SCALING_15 |
1 | OpenDrawing(250;150) |
2 | ChartData(36 18 14 18 13 8 5) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;5;1;darkRed;;white) |
7 | /* Set up axes. */ |
8 | |
9 | |
10 | AxisMajorTicks(x;5;0.25;#333;;out) |
11 | AxisMajorTicks(y;0) |
12 | /* Set up grid. */ |
13 | MajorGridLineWidths(y;x;0) /* Hide vertical grid lines. */ |
14 | MajorGridLineWidths(x;y;0.25) |
15 |