AxisMajorTickLabelBackground
AxisMajorTickLabelBackground ( axisIndex ; fillColor ; fillColorVariant ; borderStroke ; borderColor ; borderColorVariant ; shadowEffect ; shadowColor )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
axisIndex | int | 0..10000 | all | |
fillColor | rgba | 0..255 | white | |
fillColorVariant | int | -1..128 | solid | |
borderStroke | num[] | 0..1000 | 1 | Dimension:[pt] |
borderColor | rgba | 0..255 | black | |
borderColorVariant | int | -1..128 | solid | |
shadowEffect | num[] | -1000..1000 | 0 | |
shadowColor | rgba | 0..255 | #888a |
Examples
AxisMajorTickLabelBackground(all;;;0) /* White background, no border. */
AxisMajorTickLabelBackground(y;yellow) /* Yellow background, black border. */
Description
A background can be added to the tick mark labels by using the AxisMajorTickLabelBackground() function. It is possible to vary the fill, border and shadow.
| AXIS_MAJOR_TICK_LABEL_BACKGROUND_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(40 65 55 85 48 61) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(1;#fdb910) |
6 | BorderStyle(1;none) |
7 | LabelOptions(1;out) /* Place labels outside of bars. */ |
8 | /* Set up axes. */ |
9 | AxisOptions(y;none) /* Hide y-axis. */ |
10 | |
11 | AxisMajorTicks(x;0) /* Hide x-axis tick marks. */ |
12 | AxisMajorTickLabelTexts(x;"Q1\n24";"Q2\n24";"Q3\n24";"Q4\n24";"Q1\n25";"Q2\n25") |
13 | AxisMajorTickLabelStyle(x;Verdana;9;bold;white) |
14 | AxisMajorTickLabelBackground(x;#3879aa;;0) |
15 | /* Set up grid. */ |
16 | GridLocation(all;none) /* Hide grid. */ |
17 |
| AXIS_MAJOR_TICK_LABEL_BACKGROUND_02 |
1 | OpenDrawing(250;150) |
2 | ChartData( 4 13 9 18; |
3 | 12 17 14 11; |
4 | 9 10 11 8) |
5 | BarChart() |
6 | /* Set up styles. */ |
7 | |
8 | |
9 | |
10 | |
11 | /* Set up axes. */ |
12 | |
13 | |
14 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
15 | AxisMajorTickLabelTexts(x;"2022";"2023";"2024";"2025") |
16 | AxisMajorTickLabelTexts(y;"";"";"";"|u|") |
17 | AxisMajorTickLabelStyle(x;Verdana;9;plain;#333) |
18 | AxisMajorTickLabelBackground(x;white;;1;white;;2 2 3) |
19 | AxisMajorTickLabelBackground(y;#fee;;1;#fee) |
20 | AxisMajorTickLabelOptions(x;;;5) |
21 | AxisMajorTickLabelOptions(y;;2) |
22 | /* Set up grid. */ |
23 | |
24 | MajorGridLineColors(x;y;none;;;red;;) |
25 | MajorGridLineWidths(x;y;0.25;0.25;0.25;0.5) |
26 | MajorGridLineWidths(y;x;0) |
27 |