AxisOptions
AxisOptions ( axisIndex ; axisLocation ; axisLayout )
| Argument | Type | Range | Default | Note |
|---|---|---|---|---|
| axisIndex | int | 0..10000 | all | |
| axisLocation | int | 0..2 | back | |
| axisLayout | int | 0..3 | 0 | Requires xmCHART 4.0.6 or higher |
Examples
AxisOptions(y;;1) /* Move y-axis to the right side of the plot area. */
AxisOptions(y;;3) /* Mirror y-axis. */
Description
By using the 2nd argument axisLocation, axes can either be arranged behind the chart (axisLocation = back) or in front of it (axisLocation = front). The latter arrangement proves useful, e.g. for polar and radar charts. As an option, axes can be completely suppressed by axisLocation = none.
| | AXIS_OPTIONS_01 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(9 16 18 15 17 13 11) |
| 3 | |
| 4 | /* Set up styles. */ |
| 5 | |
| 6 | SymbolStyle(1;circle;4.5;1;#4682b4;;white) |
| 7 | ShadowStyle(all;2 2 3) |
| 8 | LabelOptions(all;topCenter;;2) /* Move labels 2 pixels up. */ |
| 9 | /* Set up axes. */ |
| 10 | AxisOptions(y;none) /* Hide y-axis. */ |
| 11 | |
| 12 | AxisMajorTicks(x;0) /* Hide x-axis tick marks. */ |
| 13 | /* Set up grid. */ |
| 14 | MajorGridLineWidths(x;y;0) |
| 15 | MajorGridLineWidths(y;x;0.25) |
| 16 |
| | AXIS_OPTIONS_02 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(18 13 15 13 10 5 12 14) |
| 3 | RadarChart(oval;90) |
| 4 | /* Set up styles. */ |
| 5 | FillStyle(1;#c4dcc0) |
| 6 | BorderStyle(1;poly;2.5;#638b5b) |
| 7 | /* Set up axes. */ |
| 8 | AxisOptions(all;back) /* Axes behind graph. */ |
| 9 | |
| 10 | AxisMajorTicks(all;8;0.25;gray) |
| 11 | /* Set up grid. */ |
| 12 | GridLocation(all;none) /* Hide grid. */ |
| 13 |
| | AXIS_OPTIONS_03 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(18 13 15 13 10 5 12 14) |
| 3 | RadarChart(oval;90) |
| 4 | /* Set up styles. */ |
| 5 | FillStyle(1;#c4dcc0) |
| 6 | BorderStyle(1;poly;2.5;#638b5b) |
| 7 | /* Set up axes. */ |
| 8 | AxisOptions(all;front) /* Axes in front of graph. */ |
| 9 | |
| 10 | AxisMajorTicks(all;8;0.25;gray) |
| 11 | /* Set up grid. */ |
| 12 | GridLocation(all;none) /* Hide grid. */ |
| 13 |
By activating the 3rd argument axisLayout, axes can be moved to the opposite side or mirrored.
| Axis Layout Flag | Description |
|---|---|
| 0 | Regular (default). |
| 1 | Move axis to the opposite side of the plot area |
| 2 | Mirror axis (axis line, tick marks, tick mark labels) |
| 3 | Mirror axis + optional axis label |
Examples:
| | AXIS_OPTIONS_04 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(16 18 25 17 13 8) |
| 3 | BarChart(horizontal;0) |
| 4 | /* Set up styles. */ |
| 5 | FillStyle(1;#4682b420) |
| 6 | BorderStyle(1;;1;#4682b4) |
| 7 | /* Set up axes. */ |
| 8 | ScalingOptions(y;on) /* y-scaling top to bottom. */ |
| 9 | AxisOptions(x;;1) /* Move x-axis to top. */ |
| 10 | |
| 11 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
| 12 | /* Set up grid. */ |
| 13 | MajorGridLineWidths(x;y;0) |
| 14 | MajorGridLineWidths(y;x;0.25) |
| 15 |
| | AXIS_OPTIONS_05 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(16 18 25 17 13 8) |
| 3 | |
| 4 | /* Set up styles. */ |
| 5 | |
| 6 | SymbolStyle(1;bullet;17;1;#3879aa) |
| 7 | ShadowStyle(all;2 2 3) |
| 8 | LabelStyle(1;Verdana;9;bold;white) |
| 9 | LabelOptions(1;centerCenter;;-1) |
| 10 | /* Set up axes. */ |
| 11 | ScalingOptions(y;on) /* y-scaling top to bottom. */ |
| 12 | AxisOptions(all;;1) /* Move axes. */ |
| 13 | |
| 14 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
| 15 | /* Set up grid. */ |
| 16 | MajorGridLineWidths(all;all;0.25) |
| 17 |
| | AXIS_OPTIONS_06 |
| 1 | OpenDrawing(250;150) |
| 2 | ChartData(12 18 7 17 17; /* 1st series. */ |
| 3 | 3 7 17 13 13) /* 2nd series. */ |
| 4 | |
| 5 | /* Set up styles. */ |
| 6 | |
| 7 | |
| 8 | SymbolStyle(1;circle;5;1;;;white) |
| 9 | SymbolStyle(2;circle;5;1;;;white) |
| 10 | |
| 11 | ShadowStyle(all;1 1 3) |
| 12 | /* Set up axes. */ |
| 13 | |
| 14 | AxisMajorTicks(all;0) |
| 15 | AxisMajorTickLabelOptions(x;;;3) |
| 16 | AxisMajorTickLabelOptions(y;;-3) |
| 17 | AxisOptions(y;;2) /* Mirror y-axis. */ |
| 18 | /* Set up grid. */ |
| 19 | MajorGridLineWidths(x;y;0.25) |
| 20 | MajorGridLineWidths(y;x;0) |
| 21 |
| | AXIS_OPTIONS_07 |
| 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 | FillStyle(3;200 200 200 50) |
| 10 | |
| 11 | BorderStyle(3;1;0.5;200 200 200) |
| 12 | /* Set up axes. */ |
| 13 | |
| 14 | |
| 15 | AxisMajorTicks(all;0) /* Hide tick marks. */ |
| 16 | AxisMajorTickLabelTexts(x;"2022";"2023";"2024";"2025") |
| 17 | AxisMajorTickLabelTexts(y;"";"";"";"|u|") |
| 18 | AxisMajorTickLabelStyle(x;Verdana;9;plain;#333) |
| 19 | AxisMajorTickLabelBackground(x;white;;1;white;;1 1 3) |
| 20 | AxisMajorTickLabelBackground(y;#fee;;1;#fee) |
| 21 | AxisMajorTickLabelOptions(x;;;5) /* Move 5 pixels down. */ |
| 22 | AxisMajorTickLabelOptions(y;;2) /* Move 2 pixels right. */ |
| 23 | AxisOptions(y;;2) /* Mirror y-axis. */ |
| 24 | /* Set up grid. */ |
| 25 | MajorGridLineColors(x;y;none;;;red;;) |
| 26 | MajorGridLineWidths(x;y;0.25;0.25;0.25;0.5) |
| 27 | MajorGridLineWidths(y;x;0) |
| 28 |
| | AXIS_OPTIONS_08 |
| 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 | AxisLabelText(y;"Revenues") |
| 14 | AxisLabelStyle(y;Arial;11;plain;#333;;-90) |
| 15 | AxisOptions(y;;3) /* Mirror y-axis and axis label. */ |
| 16 | /* Set up grid. */ |
| 17 | MajorGridLineWidths(x;y;0.25) |
| 18 | MajorGridLineWidths(y;x;0) |
| 19 |