LineChart

LineChart ( appearanceConst ;​ doShiftIntervals )

Argument Type Range Default Note
appearanceConst int 0..127 default
doShiftIntervals int 0..1 off
Description

The LineChart() function serves to draw one-dimensional line charts.

LINE_CHART_01
1

OpenDrawing(250;​150)

2

ChartData(12 14 8 17 9;​ /* 1st series. */

3

3 7 15 12 14) /* 2nd series. */

4

LineChart()

5

/* Set up styles. */

6

LineStyle(1;​poly;​1.5 2 2;​#3879aa)

7

LineStyle(2;​poly;​1.5;​#fdb910)

8

/* Set up axes. */

9

AxisLine(all;​0)

10

AxisMajorTicks(all;​0)

11

AxisMajorTickLabelOptions(x;​;​;​2)

12

AxisMajorTickLabelOptions(y;​;​-2)

13

/* Set up grid. */

14

MajorGridLineWidths(all;​all;​0.25)

15

GridFrame(xy;​0.5;​#888)

16

CloseDrawing()

LINE_CHART_01

The 1st argument appearanceConstants makes it possible to rotate the chart 90 degrees (appearanceConstants = horizontal) and to add symbols (appearanceConstants = symbol), shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) to the lines. All options can be combined by using a plus sign "+".

LINE_CHART_02
1

OpenDrawing(250;​150)

2

ChartData(12 14 8 17 9;​ /* 1st series. */

3

3 7 15 12 14) /* 2nd series. */

4

LineChart(shadow+horizontal+symbol)

5

/* Set up styles. */

6

LineStyle(1;​poly;​1.5 2 2;​#3879aa)

7

LineStyle(2;​poly;​1;​#c002a0)

8

SymbolStyle(1;​circle;​5;​1;​#3879aa;​;​white)

9

SymbolStyle(2;​circle;​5;​1;​#c002a0;​;​white)

10

ShadowStyle(all;​2 2 3)

11

/* Set up axes. */

12

ScalingOptions(y;​on) /* y-scale top to bottom. */

13

AxisLine(all;​0)

14

AxisMajorTicks(all;​0)

15

AxisMajorTickLabelOptions(x;​;​;​3)

16

AxisMajorTickLabelOptions(y;​;​-3)

17

/* Set up grid. */

18

MajorGridLineWidths(x;​y;​0)

19

MajorGridLineWidths(y;​x;​0.25)

20

CloseDrawing()

LINE_CHART_02

The lines, symbols and shadows can be varied by using the style functions LineColorScheme() , LineStyle() , SymbolColorScheme() , SymbolStyle() and ShadowStyle() and the labels by using the 4 style functions LabelTexts() , LabelStyle() , LabelBackground() and LabelOptions() .

LINE_CHART_03
1

OpenDrawing(250;​150)

2

ChartData(12 18 7 17 17;​ /* 1st series. */

3

3 7 17 13 13) /* 2nd series. */

4

LineChart(shadow+symbol)

5

/* Set up styles. */

6

LineColorScheme(16)

7

SymbolColorScheme(16)

8

SymbolStyle(1;​circle;​5;​1;​;​;​white)

9

SymbolStyle(2;​circle;​5;​1;​;​;​white)

10

ShadowStyle(all;​2 2 3)

11

/* Set up axes. */

12

AxisLine(all;​0)

13

AxisMajorTicks(all;​0)

14

AxisMajorTickLabelOptions(x;​;​;​3)

15

AxisMajorTickLabelOptions(y;​;​-3)

16

/* Set up grid. */

17

MajorGridLineWidths(x;​y;​0.25)

18

MajorGridLineWidths(y;​x;​0)

19

CloseDrawing()

LINE_CHART_03
LINE_CHART_04
1

OpenDrawing(250;​150)

2

ChartData(13 12 10 13 11;​ /* 1st series. */

3

3 7 2 8 5) /* 2nd series. */

4

LineChart(shadow+symbol)

5

/* Set up styles. */

6

LineStyle(1;​jump;​1;​#3879aa)

7

LineStyle(2;​step;​1;​#c002a0)

8

SymbolStyle(1;​circle;​5;​1;​#3879aa;​;​white)

9

SymbolStyle(2;​circle;​5;​1;​#c002a0;​;​white)

10

ShadowStyle(all;​2 2 3)

11

/* Set up axes. */

12

AxisLine(all;​0)

13

AxisMajorTicks(all;​0)

14

AxisMajorTickLabelOptions(x;​;​;​3)

15

AxisMajorTickLabelOptions(y;​;​-3)

16

/* Set up grid. */

17

MajorGridLineWidths(x;​y;​0.25)

18

MajorGridLineWidths(y;​x;​0)

19

CloseDrawing()

LINE_CHART_04
LINE_CHART_05
1

OpenDrawing(250;​150)

2

ChartData(12 14 11 13 10;​

3

2 8 3 7 7)

4

LineChart(symbol+label+shadow)

5

/* Set up styles. */

6

LineStyle(1;​smooth;​1;​#3879aa)

7

LineStyle(2;​poly;​1;​#c002a0)

8

SymbolStyle(1;​circle;​5;​1;​#3879aa;​;​white)

9

SymbolStyle(2;​bullet;​15;​1;​#c002a0;​shaded)

10

ShadowStyle(all;​2 2 3)

11

LabelTexts(1;​"")

12

LabelStyle(2;​Verdana;​10;​bold;​white)

13

LabelOptions(2;​centerCenter;​;​-1)

14

/* Set up axes. */

15

AxisLine(all;​0)

16

AxisMajorTicks(all;​0)

17

AxisMajorTickLabelOptions(x;​;​;​3)

18

AxisMajorTickLabelOptions(y;​;​-3)

19

/* Set up grid. */

20

MajorGridLineWidths(x;​y;​0.25)

21

MajorGridLineWidths(y;​x;​0)

22

CloseDrawing()

LINE_CHART_05

For one-dimensional line charts it is possible to move the polygon points half an interval width so that they do not lie on the interval borders but rather in the middle of the intervals. This can be done by activating the 2nd argument doShiftIntervals = on.

LINE_CHART_06
1

OpenDrawing(250;​150)

2

ChartData(15 17 13 17 15 8)

3

LineChart(symbol+label;​on)

4

/* Set up styles. */

5

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

6

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

7

LabelOptions(1;​topCenter)

8

/* Set up axes. */

9

AxisLine(all;​0)

10

AxisMajorTicks(all;​0)

11

/* Set up grid. */

12

MajorGridLineWidths(x;​y;​0)

13

MajorGridLineWidths(y;​x;​0.25)

14

CloseDrawing()

LINE_CHART_06

In addition, it is possible to draw discontinuous lines by replacing the missing values in ChartData() with NULL.

LINE_CHART_07
1

OpenDrawing(250;​150)

2

ChartData(7 16 12 null 9 7 null 5)

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

Scaling(y;​linear;​0)

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

AxisMajorTickLabelOptions(x;​;​;​3)

13

AxisMajorTickLabelOptions(y;​;​-3)

14

/* Set up grid. */

15

MajorGridLineWidths(x;​y;​0.25)

16

MajorGridLineWidths(y;​x;​0)

17

CloseDrawing()

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

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

×