LegendBackground

LegendBackground ( fillColor ;​ fillColorVariant ;​ borderStroke ;​ borderColor ;​ borderColorVariant ;​ shadowEffect ;​ shadowColor )

Argument Type Range Default Note
fillColor rgba 0..255 white
fillColorVariant int -1..128 solid
borderStroke num[] 0..1000 1 Dimension:[pt]
borderColor rgba 0..255 black
borderColorVariant int -1..128 solid
shadowEffect num[] -1000..1000 0
shadowColor rgba 0..255 #888a
Examples
Description

The background of the legend can be designed by using the LegendBackground() function. It is possible to vary the fill, border and shadow as well.

LEGEND_BACKGROUND_01
1

OpenDrawing(250;​150)

2

ChartData(1 4;​ 2 3;​ 3 2)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​160 160 160 220)

6

FillStyle(2;​120 120 120 220)

7

FillStyle(3;​200 50 50 220)

8

BorderStyle(all;​none)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up legend. */

13

LegendTexts("Employee 1 ";​"Employee 2 ";​"Employee 3 ")

14

LegendBackground(white;​;​0.25;​black)

15

/* Set up grid. */

16

MajorGridLineWidths(x;​y;​0.25)

17

MajorGridLineWidths(y;​x;​0)

18

CloseDrawing()

LEGEND_BACKGROUND_01
LEGEND_BACKGROUND_02
1

OpenDrawing(250;​150)

2

ChartData(1 4;​ 2 3;​ 3 2)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​160 160 160 220)

6

FillStyle(2;​120 120 120 220)

7

FillStyle(3;​200 50 50 220)

8

BorderStyle(all;​none)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up legend. */

13

LegendTexts("Employee 1 ";​"Employee 2 ";​"Employee 3 ")

14

/* Light gray background with a 0.5 pixel */

15

/* wide gray border and shadow. */

16

LegendBackground(#f0f0f0;​;​0.5;​gray;​;​2 2 3)

17

/* Set up grid. */

18

MajorGridLineWidths(x;​y;​0.25)

19

MajorGridLineWidths(y;​x;​0)

20

CloseDrawing()

LEGEND_BACKGROUND_02
LEGEND_BACKGROUND_03
1

OpenDrawing(250;​150)

2

ChartData(1 4;​ 2 3;​ 3 2)

3

BarChart()

4

/* Set up styles. */

5

FillStyle(1;​160 160 160 220)

6

FillStyle(2;​120 120 120 220)

7

FillStyle(3;​200 50 50 220)

8

BorderStyle(all;​none)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up legend. */

13

LegendTexts("Employee 1";​"Employee 2";​"Employee 3")

14

LegendBackground(white;​;​6;​white;​;​2 2 3) /* Increased white background with shadow. */

15

/* Set up grid. */

16

MajorGridLineWidths(x;​y;​0.25)

17

MajorGridLineWidths(y;​x;​0)

18

CloseDrawing()

LEGEND_BACKGROUND_03
Scroll to Top