AreaChartOptions

AreaChartOptions ( useLineStyle ;​ referenceValue ;​ splitPosNegStacks )

Argument Type Range Default Note
useLineStyle int 0..1 off
referenceValue num -inf..+inf 0
splitPosNegStacks int 0..1 on
Description

As an option, a line can be added to the border by activating the argument useLineStyle = on. Unlike the default border, which covers the entire area, i.e. including the side borders and the base line, the line will only be drawn between the chart values. This can be used, for example, to draw an area and line chart simultaneously; the fill of one series is made invisible. The appearance of the line can be controlled by the LineStyle() function. The 2nd argument shape in the LineStyle() function, which normally serves to control the shape of the curve, is ignored in this context.

AREA_CHART_OPTIONS_01
1

OpenDrawing(250;​150)

2

ChartData(5 16 9 13 13 8;​ /* Line */

3

8 13 15 12 9 12) /* Area */

4

AreaChart()

5

AreaChartOptions(on) /* After AreaChart() */

6

/* Set up styles. */

7

FillStyle(1;​none)

8

FillStyle(2;​#4682b420)

9

LineStyle(1;​;​1.5;​darkRed)

10

LineStyle(2;​;​1.0;​#4682b4)

11

BorderStyle(all;​poly;​0)

12

/* Set up axes. */

13

AxisLine(all;​0)

14

AxisMajorTicks(all;​0)

15

/* Set up grid. */

16

MajorGridLineWidths(x;​y;​0.25)

17

MajorGridLineWidths(y;​x;​0)

18

CloseDrawing()

AREA_CHART_OPTIONS_01

The 2nd argument referenceValue makes it possible to define the base line of the areas. As the default, all areas start at zero, i.e. referenceValue =​ 0.

AREA_CHART_OPTIONS_02
1

OpenDrawing(250;​150)

2

ChartData(5 13 8 18 11 0)

3

AreaChart()

4

AreaChartOptions(;​10) /* After AreaChart() */

5

/* Set up styles. */

6

FillStyle(1;​#4682b420)

7

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

8

/* Set up axes. */

9

AxisLine(all;​0)

10

AxisMajorTicks(all;​0)

11

/* Set up grid. */

12

MajorGridLineWidths(x;​y;​0.25)

13

MajorGridLineWidths(y;​x;​0)

14

CloseDrawing()

AREA_CHART_OPTIONS_02

The 3rd argument splitPosNegStacks can be used to control the stacking of negative values. As the default, positive and negative values are stacked separately (splitPosNegStacks = on), i.e. positive values are added up "above" the reference line, negative values "below" it.

AREA_CHART_OPTIONS_03
1

OpenDrawing(250;​150)

2

ChartData(4 9 10 15 13 18;​

3

2 -3 -2 -4 -2 2)

4

AreaChart(stacked)

5

AreaChartOptions(;​;​on) /* After AreaChart() */

6

/* Set up styles. */

7

FillColorScheme(6;​solid;​0.35)

8

BorderStyle(all;​poly;​1;​gray)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(all;​all;​0.25)

14

GridFrame(xy;​0.5;​gray)

15

CloseDrawing()

AREA_CHART_OPTIONS_03

If splitPosNegStacks = off is set, positive and negative values will not be stacked separately.

AREA_CHART_OPTIONS_04
1

OpenDrawing(250;​150)

2

ChartData(4 9 10 15 13 18;​

3

2 -3 -2 -4 -2 2)

4

AreaChart(stacked)

5

AreaChartOptions(;​;​off) /* After AreaChart() */

6

/* Set up styles. */

7

FillColorScheme(6;​solid;​0.35)

8

BorderStyle(all;​poly;​1;​gray)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(all;​all;​0.25)

14

GridFrame(xy;​0.5;​gray)

15

CloseDrawing()

AREA_CHART_OPTIONS_04

Please note that the AreaChartOptions() function should be listed after the AreaChart() function. This rule generally applies: chart options should always be listed after the actual chart function.

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

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

×