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
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

BarChart(label)

5

/* Set up styles. */

6

FillStyle(1;​#005ca9;​shaded)

7

FillStyle(2;​#a2e4f9;​shaded)

8

BorderStyle(all;​none)

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

AxisLine(x;​0) /* Hide x-axis line. */

14

AxisMajorTicks(x;​0) /* Hide x-axis tick marks. */

15

AxisMajorTickLabelStyle(x;​Verdana;​9;​plain;​#333)

16

AxisMajorTickLabelTexts(x;​"2015";​"2016";​"2017";​"2018")

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

CloseDrawing()

AXIS_MAJOR_TICK_LABEL_OPTIONS_01
AXIS_MAJOR_TICK_LABEL_OPTIONS_02
1

OpenDrawing(250;​150)

2

ChartData(25 19 16 15 13 10 4)

3

LineChart(symbol+shadow;​on)

4

/* Set up styles. */

5

LineStyle(1;​poly;​1;​#4682b4)

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

AxisLine(all;​0) /* Hide axis lines. */

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

CloseDrawing()

AXIS_MAJOR_TICK_LABEL_OPTIONS_02

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

BarChart(label+shadow)

4

/* Set up styles. */

5

FillStyle(1;​#4682b4)

6

BorderStyle(all;​none)

7

ShadowStyle(all;​2 2 3)

8

LabelOptions(all;​out) /* Place labels outside of bars. */

9

/* Set up axes. */

10

AxisLine(x;​0) /* Hide x-axis line. */

11

AxisMajorTicks(x;​0) /* Hide x-axis tick marks. */

12

AxisLine(y;​0.25;​black)

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

CloseDrawing()

AXIS_MAJOR_TICK_LABEL_OPTIONS_03
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

LineChart(symbol)

4

/* Set up styles. */

5

LineStyle(1;​poly;​1;​#4682b4)

6

SymbolStyle(1;​circle;​5;​1;​#4682b4;​;​white)

7

/* Set up axes. */

8

Scaling(x;​linear;​0;​20;​20)

9

AxisLine(all;​0) /* Hide axis lines. */

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

CloseDrawing()

AXIS_MAJOR_TICK_LABEL_OPTIONS_04
Scroll to Top
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×