MajorGridLineWidths

MajorGridLineWidths ( directionAxis ;​ distributionAxis ;​ stroke1 ;​ stroke2 ;​ . . . ;​ stroke1000 )

Argument Type Range Default Note
directionAxis int 0..3 all
distributionAxis int 0..3 all
stroke1 num[] 0..1000 1
stroke2 num[] 0..1000 1
... num[] 0..1000 1
stroke1000 num[] 0..1000 1
Examples

MajorGridLineWidths(x;​y;​1;​2) /* Horizontal grid lines. */

MajorGridLineWidths(y;​x;​0) /* Hide vertical grid lines. */

MajorGridLineWidths(y;​x;​1 2 2) /* Dotted grid lines. */

Description

Grid lines can be defined differently with regard to stroke, color and color variant. If the number of grid lines is larger than the number of defined strokes, colors or color variants, the latter will be repeated periodically. 1-pixel wide, gray grid lines are used as the default.

MAJOR_GRID_LINE_WIDTHS_01
1

OpenDrawing(250;​150)

2

ChartData(1.5 2.5 1 3 2.5)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​#4682b420)

6

BorderStyle(1;​;​1;​#4682b4)

7

/* Set up axes. */

8

AxisLine(all;​0)

9

AxisMajorTicks(all;​0)

10

/* Set up grid. */

11

MajorGridLineColors(all;​all;​lightGray)

12

CloseDrawing()

MAJOR_GRID_LINE_WIDTHS_01

Grid lines can be suppressed by defining the line width as zero or the line color as none. If neither the directional axis nor the distribution axis is defined, the functions refer to all grid lines, i.e. for 2-dimensional Cartesian charts to both the horizontal and vertical grid lines. Access to a special grid direction is obtained by using both arguments directionAxis and distributionAxis.

Cartesian charts directionAxis distributionAxis Example
Horizontal grid lines x y MajorGridLineWidths(x;y;0.5)
Vertical grid lines y x MajorGridLineWidths(y;x;1;1;0)
Polar charts directionAxis distributionAxis Example
Radial grid lines x y MajorGridLineWidths(x;y;0.25)
Concentric grid lines y x MajorGridLineWidths(y;x;0)

In addition, for 3-dimensional bar and Gantt charts the axis constant z is available. The z-axis points in the direction of the viewer.

MAJOR_GRID_LINE_WIDTHS_02
1

OpenDrawing(250;​150)

2

ChartData(1.5 2.5 1 3 2.5)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​#4682b420)

6

BorderStyle(1;​;​1;​#4682b4)

7

/* Set up axes. */

8

AxisLine(all;​0)

9

AxisMajorTicks(all;​0)

10

/* Set up grid. */

11

MajorGridLineColors(x;​y;​lightGray;​lightGray;​red;​lightGray) /* Horizontal grid lines. */

12

MajorGridLineWidths(y;​x;​0) /* Hide vertical grid lines. */

13

CloseDrawing()

MAJOR_GRID_LINE_WIDTHS_02
MAJOR_GRID_LINE_WIDTHS_03
1

OpenDrawing(250;​150)

2

ChartData(1.5 2.5 1 3 2.5)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​#4682b420)

6

BorderStyle(1;​;​1;​#4682b4)

7

/* Set up axes. */

8

AxisLine(all;​0)

9

AxisMajorTicks(x;​0)

10

AxisMajorTicks(y;​6;​1;​black;​;​out)

11

/* Set up grid. */

12

MajorGridLineColors(y;​x;​gray)

13

MajorGridLineWidths(x;​y;​0) /* Hide horizontal grid lines. */

14

GridFrame(xy;​1;​gray) /* 1 pixel wide gray border. */

15

CloseDrawing()

MAJOR_GRID_LINE_WIDTHS_03

Furthermore, a dash pattern can be assigned to the grid line width by adding a list of dash lengths and gaps.

MAJOR_GRID_LINE_WIDTHS_04
1

OpenDrawing(250;​150)

2

ChartData(1.5 2.5 1 3 2.5)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​#4682b420)

6

BorderStyle(1;​;​1;​#4682b4)

7

/* Set up axes. */

8

AxisLine(all;​0)

9

AxisMajorTicks(all;​0)

10

/* Set up grid. */

11

MajorGridLineColors(x;​y;​lightGray;​lightGray;​red;​lightGray) /* Horizontal grid lines. */

12

MajorGridLineWidths(x;​y;​1;​1;​1 9 3;​1) /* Dash pattern: 1 9 3 */

13

MajorGridLineWidths(y;​x;​0) /* Hide vertical grid lines. */

14

CloseDrawing()

MAJOR_GRID_LINE_WIDTHS_04
MAJOR_GRID_LINE_WIDTHS_05
1

OpenDrawing(250;​150)

2

OpenChart(10;​15;​200;​120;​on)

3

ChartData(4 10 13 15 16 19 25)

4

LineChart(symbol+shadow;​on)

5

/* Set up styles. */

6

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

7

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

8

ShadowStyle(all;​2 2 3)

9

/* Set up axes. */

10

Scaling(y;​linear;​0;​25;​5)

11

AxisOptions(y;​;​1) /* Move y-axis to the right. */

12

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

13

AxisMajorTicks(x;​1;​0.025;​gray;​;​out)

14

AxisMajorTicks(y;​1;​0.025;​gray;​;​out)

15

AxisMajorTickLabelOptions(x;​center)

16

AxisMajorTickLabelOptions(y;​;​3) /* Move 3 pixels right. */

17

AxisMajorTickLabelTexts(y;​"$|u|")

18

/* Set up grid. */

19

MajorGridLineWidths(x;​y;​0.5 1 26.57 1 0) /* Horizontal grid points. */

20

MajorGridLineWidths(y;​x;​0.5 1 22 1 0) /* Vertical grid points. */

21

CloseChart()

22

CloseDrawing()

MAJOR_GRID_LINE_WIDTHS_05

More dash pattern examples can be found under Dash Patterns.

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

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

×