LegendColorScale

New in version 5.0

LegendColorScale ( scaleValues ;​ doReverseScale ;​ scaleInset ;​ tickLength ;​ tickOffset ;​ tickStroke ;​ tickColor ;​ doMirrorTicks ;​ numOfSubTicks ;​ subTickLength ;​ labelFormat ;​ borderStroke ;​ borderColor )

Argument Type Range Default Note
scaleValues num[] -inf..+inf (required)
doReverseScale int 0..1 off
scaleInset num[] 0..1000 0 Dimension:[pt]
tickLength num 0..1000 5 Dimension:[pt]
tickOffset num -1000..1000 0 Dimension:[pt]
tickStroke num[] 0..1000 1
tickColor rgba 0..255 black
doMirrorTicks int 0..1 off
numOfSubTicks int[] 0..1000 0
subTickLength num 0..1000 3 Dimension:[pt]
labelFormat styt 0..1000 "|u|" Max. 1000 chars.
borderStroke num[] 0..1000 0
borderColor rgba 0..255 black
Description

The functions LegendColorScale() and LegendColorTones() make it possible to add a legend to heat maps, tree maps and density plots.
The scale values can be overridden by using the function LegendTexts() .

LEGEND_COLOR_SCALE_01
1

OpenDrawing(400;​150)

2

ChartData(4 2 1 0 1 2 4 7 10 13 16 18 19 18 18 17 15 13 10 8 5 3 2 2 2 3 5 8 10 13 15 17 18 16 16 15 13 12 10)

3

TreeMap()

4

FillColorScale(1;​9)

5

BorderStyle(all;​;​1;​#333)

6

LegendStyle(Verdana;​9)

7

LegendOptions(bottomCenter;​

8

0;​ /* Place legend inside of plot area. */

9

0;​ /* Horizontal offset.  */

10

3;​ /* Vertical offset.  */

11

1;​ /* Number of rows (ignored).  */

12

0;​ /* Legend item type (ignored).  */

13

200;​ /* Color scale length.  */

14

15;​ /* Color scale height.  */

15

3;​ /* Gap between text and ticks.  */

16

0;​ /* Row gap (ignored).  */

17

0;​ /* Column gap (ignored).  */

18

bottomCenter) /* Text location.  */

19

LegendColorScale(0 5 10 15 20;​ /* Scale values.  */

20

0;​ /* Do reverse scale. */

21

0;​ /* Scale inset.  */

22

6;​ /* Tick length.  */

23

0;​ /* Tick offset.  */

24

1;​ /* Tick stroke.  */

25

#333;​ /* Tick color.  */

26

0;​ /* Do mirror ticks.  */

27

5;​ /* Num of sub-ticks. */

28

3;​ /* Sub-tick length.  */

29

"|u|";​ /* Label format.  */

30

1;​ /* Border stroke.  */

31

#333) /* Border color.  */

32

CloseDrawing()

LEGEND_COLOR_SCALE_01
LEGEND_COLOR_SCALE_02
1

OpenDrawing(220;​150)

2

OpenChart(15;​15;​150;​120;​on)

3

ChartData(10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 13 13 13 12 11 10 9 8 8 7 7 7 8 8 9 10 11 12 13 13 16 16 15 13 12 10 8 7 5 4 4 4 5 7 8 10 12 13 15 16 18 18 17 15 13 10 8 5 3 2 2 2 3 5 8 10 13 15 17 18 20 19 18 16 13 10 7 4 2 1 0 1 2 4 7 10 13 16 18 19 20 20 18 16 13 10 7 4 2 0 0 0 2 4 7 10 13 16 18 20 20 19 18 16 13 10 7 4 2 1 0 1 2 4 7 10 13 16 18 19 18 18 17 15 13 10 8 5 3 2 2 2 3 5 8 10 13 15 17 18 16 16 15 13 12 10 8 7 5 4 4 4 5 7 8 10 12 13 15 16 13 13 13 12 11 10 9 8 8 7 7 7 8 8 9 10 11 12 13 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 7 8 8 9 10 11 12 13 13 13 13 13 12 11 10 9 8 8 7 4 4 5 7 8 10 12 13 15 16 16 16 15 13 12 10 8 7 5 4 2 2 3 5 8 10 13 15 17 18 18 18 17 15 13 10 8 5 3 2 0 1 2 4 7 10 13 16 18 19 20 19 18 16 13 10 7 4 2 1 0 0 2 4 7 10 13 16 18 20 20 20 18 16 13 10 7 4 2 0 0 1 2 4 7 10 13 16 18 19 20 19 18 16 13 10 7 4 2 1 2 2 3 5 8 10 13 15 17 18 18 18 17 15 13 10 8 5 3 2 4 4 5 7 8 10 12 13 15 16 16 16 15 13 12 10 8 7 5 4 7 7 8 8 9 10 11 12 13 13 13 13 13 12 11 10 9 8 8 7)

4

HeatMap()

5

/* Set up styles. */

6

FillColorScale(1;​25;​shaded)

7

BorderStyle(1;​none)

8

LegendStyle(Verdana;​9)

9

LegendOptions(centerRight;​

10

0;​ /* Place legend inside of plot area. */

11

5;​ /* Horizontal offset.  */

12

3;​ /* Vertical offset.  */

13

1;​ /* Number of rows (ignored).  */

14

0;​ /* Legend item type (ignored).  */

15

10;​ /* Color scale width.  */

16

100;​ /* Color scale height.  */

17

3;​ /* Gap between text and ticks.  */

18

0;​ /* Row gap (ignored).  */

19

0;​ /* Column gap (ignored).  */

20

6) /* Text location.  */

21

LegendColorScale(0 5 10 15 20;​ /* Scale values.  */

22

1;​ /* Do reverse scale. */

23

3;​ /* Scale inset.  */

24

4;​ /* Tick length.  */

25

0;​ /* Tick offset.  */

26

1;​ /* Tick stroke.  */

27

#333;​ /* Tick color.  */

28

0;​ /* Do mirror ticks.  */

29

0;​ /* Num of sub-ticks. */

30

3;​ /* Sub-tick length.  */

31

"|u|";​ /* Label format.  */

32

1;​ /* Border stroke.  */

33

#333) /* Border color.  */

34

CloseChart()

35

CloseDrawing()

LEGEND_COLOR_SCALE_02

See also function LegendColorTones() .

Scroll to Top