AxisMajorTickLabelOptions
AxisMajorTickLabelOptions ( axisIndex ; location ; hOffset ; vOffset ; labelEveryNthTickMark ; startAtTickMark )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
axisIndex | int | 0..10000 | all | |
location | int | 1..3 | out | |
hOffset | num | -10000..10000 | 0 | Dimension:[pt] |
vOffset | num | -10000..10000 | 0 | Dimension:[pt] |
labelEveryNthTickMark | int | 1..1e6 | 1 | |
startAtTickMark | int | 1..1e6 | 1 |
Examples
AxisMajorTickLabelOptions(y;;-3)
AxisMajorTickLabelOptions(x;;;;5)
Description
The AxisMajorTickLabelOptions() function serves to position and finely adjust the scaling labels. The argument location makes it possible to position the labels either inside the chart (location = in) or outside the chart (location = out) or directly on the axis line (location = center). By using the arguments hOffset and vOffset, the location of the labels can be finely adjusted. Positive offset values move the labels down to the right, negative values up to the left.
| AXIS_MAJOR_TICK_LABEL_OPTIONS_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(14 13 9 18; |
3 | 12 17 14 11) |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | |
8 | |
9 | LabelOptions(all;out) /* Place labels outside of bars. */ |
10 | /* Set up axes. */ |
11 | AxisOptions(x;front) /* Axis labels in front of chart. */ |
12 | AxisOptions(y;none) /* Hide y-axis. */ |
13 | |
14 | AxisMajorTicks(x;0) /* Hide x-axis tick marks. */ |
15 | AxisMajorTickLabelStyle(x;Verdana;9;plain;#333) |
16 | AxisMajorTickLabelTexts(x;"2021";"2022";"2023";"2024") |
17 | AxisMajorTickLabelBackground(x;#efe;;1;#efe;;1) |
18 | AxisMajorTickLabelOptions(x;in;;-2) /* Move 2 pixels up. */ |
19 | /* Set up grid. */ |
20 | GridLocation(all;none) /* Hide grid. */ |
21 |
| AXIS_MAJOR_TICK_LABEL_OPTIONS_02 |
1 | OpenDrawing(250;150) |
2 | ChartData(25 19 16 15 13 10 4) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;5;1;#4682b4;;white) |
7 | ShadowStyle(all;2 2 3) |
8 | /* Set up axes. */ |
9 | ScalingOptions(y;on) /* y-scaling top to bottom. */ |
10 | AxisOptions(y;;1) /* Move y-axis to the right. */ |
11 | |
12 | AxisMajorTicks(y;0) /* Hide y-axis tick marks. */ |
13 | AxisMajorTicks(x;8;0.25;gray;;in) |
14 | AxisMajorTickLabelOptions(x;in;;8) /* Move 8 pixels down. */ |
15 | AxisMajorTickLabelOptions(y;;3) /* Move 3 pixels right. */ |
16 | /* Set up grid. */ |
17 | MajorGridLineWidths(x;y;0.25) |
18 | MajorGridLineWidths(y;x;0) |
19 |
Scaling labels can be suppressed by using the arguments labelEveryNthTickMark and startAtTickMark. For example, when the 3rd tick mark, 5th tick mark, 7th tick mark, etc. are to be labeled, the arguments labelEveryNthTickMark and startAtTickMark should be set to 2 and 3, respectively.
| AXIS_MAJOR_TICK_LABEL_OPTIONS_03 |
1 | OpenDrawing(250;150) |
2 | ChartData(13 22 10 15 13 16) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#4682b4) |
6 | |
7 | ShadowStyle(all;2 2 3) |
8 | LabelOptions(all;out) /* Place labels outside of bars. */ |
9 | /* Set up axes. */ |
10 | |
11 | AxisMajorTicks(x;0) /* Hide x-axis tick marks. */ |
12 | |
13 | AxisMajorTicks(y;6;0.25;black;;out) |
14 | AxisMajorTickLabelTexts(y;"$|u|") |
15 | AxisMajorTickLabelOptions(y;;;;1;2) /* Hide "$0" */ |
16 | /* Set up grid. */ |
17 | GridLocation(all;none) /* Hide grid. */ |
18 |
| AXIS_MAJOR_TICK_LABEL_OPTIONS_04 |
1 | OpenDrawing(250;150) |
2 | ChartData(12 14 18 17 15 16 17 18 19 22 26 18 15 12 10 8 6 4) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | SymbolStyle(1;circle;5;1;#4682b4;;white) |
7 | /* Set up axes. */ |
8 | |
9 | |
10 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
11 | AxisMajorTickLabelOptions(x;;;;5) /* Show every 5th value. */ |
12 | AxisMajorTickLabelOptions(y;;;;1;2) /* Hide "0" */ |
13 | /* Set up grid. */ |
14 | MajorGridLineWidths(all;all;0.25) |
15 |