BarChartOptions

BarChartOptions ( showConnectingLines ;​ referenceValue ;​ makeColorSplit )

Argument Type Range Default Note
showConnectingLines int 0..1 off
referenceValue num -inf..+inf 0
makeColorSplit int 0..1 off
Examples
Description

By activating the 1st argument showConnectingLines = on, the (in this case normally stacked) bars are connected by lines. The appearance of the lines can be controlled by the LineStyle() function. Please note that the BarChartOptions() function should be listed after the BarChart() function. This rule generally applies: chart options should always be listed after the actual chart function.

BAR_CHART_OPTIONS_01
1

OpenDrawing(250;​150)

2

ChartData( 4 13 12 18 9 10;​

3

12 17 14 11 13 12;​

4

9 10 11 8 12 3)

5

BarChart(proportional)

6

BarChartOptions(on)

7

/* Set up styles. */

8

FillStyle(1;​#005ca9)

9

FillStyle(2;​#00afef)

10

FillStyle(3;​#cbdb29)

11

BorderStyle(all;​none)

12

LineStyle(all;​poly;​0.25;​black)

13

/* Set up axes. */

14

Scaling(y;​percent)

15

AxisLine(all;​0)

16

AxisMajorTicks(all;​0)

17

/* Set up grid. */

18

MajorGridLineWidths(y;​x;​0)

19

MajorGridLineWidths(x;​y;​0.25)

20

CloseDrawing()

BAR_CHART_OPTIONS_01

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

BAR_CHART_OPTIONS_02
1

OpenDrawing(250;​150)

2

ChartData( 4 13 12 18 9 10;​

3

12 17 14 11 13 12;​

4

9 10 11 8 12 3)

5

BarChart(shadow)

6

BarChartOptions(;​10) /* Reference value = 10 */

7

/* Set up styles. */

8

FillStyle(1;​#005ca9)

9

FillStyle(2;​#00afef)

10

FillStyle(3;​#cbdb29)

11

BorderStyle(all;​none)

12

ShadowStyle(all;​2 2 3)

13

/* Set up axes. */

14

AxisLine(all;​0)

15

AxisMajorTicks(all;​0)

16

/* Set up grid. */

17

MajorGridLineWidths(y;​x;​0)

18

MajorGridLineWidths(x;​y;​0.25)

19

CloseDrawing()

BAR_CHART_OPTIONS_02

By activating the 3rd argument makeColorSplit = on, the positive and negative values are represented by different colored bars. The appearance of the "positive bars", i.e. the chart values are greater than the reference value, can be controlled by using style functions with odd series indices; the appearance of "negative bars" by using style functions with even series indices.

BAR_CHART_OPTIONS_03
1

OpenDrawing(250;​150)

2

ChartData(108 98 96 101 95 107 102 92)

3

BarChart()

4

BarChartOptions(;​100;​on) /* Reference value = 100 */

5

/* Set up styles. */

6

FillStyle(1;​#4682b4) /* "Positive bars", odd series index. */

7

FillStyle(2;​red) /* "Negative bars", even series index. */

8

BorderStyle(all;​none)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(y;​x;​0)

14

MajorGridLineWidths(x;​y;​0.25)

15

CloseDrawing()

BAR_CHART_OPTIONS_03
BAR_CHART_OPTIONS_04
1

OpenDrawing(250;​150)

2

OpenChart(30;​30;​210;​90;​on)

3

ChartData(16.2 15.1 12.4 11.9 9.9 7.5 7.2 4.3 2.3 -1.3 -3.3 -4.5 -6.9)

4

BarChart(label+shadow;​40)

5

BarChartOptions(off;​0;​on) /* Reference value = 0*/

6

/* Set up styles. */

7

FillStyle(1;​#4682b4) /* "Positive bars", odd series index. */

8

FillStyle(2;​#e80000) /* "Negative bars", even series index. */

9

BorderStyle(all;​none)

10

LabelTexts(1;​" |f1|")

11

LabelTexts(2;​"(|!f1|) ")

12

LabelStyle(1;​Arial;​10;​plain;​#444;​;​-90)

13

LabelStyle(2;​Arial;​10;​plain;​#e80000;​;​-90)

14

LabelOptions(all;​out)

15

ShadowStyle(all;​1 1 3)

16

/* Set up axes. */

17

AxisOptions(all;​none) /* Hide y-axis. */

18

AxisMajorTicks(all;​0)

19

GridLocation(all;​none) /* Hide grid. */

20

CloseChart()

21

CloseDrawing()

BAR_CHART_OPTIONS_04

Please note that the color split for the legend is not supported.

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

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

×