LegendTitle
LegendTitle ( title ; font ; size ; style ; color ; hAlignment ; vGap ; orientation ; textWidthMax ; textHeightMax ; ellipsisPosition ; shadowEffect ; shadowColor )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
title | styt | 0..1000 | "" | Max. 1000 chars. |
font | str | 0..1000 | ApplFont | |
size | num | 0..1000 | 9 | Dimension:[pt] |
style | int | 0..7 | plain | |
color | rgba | 0..255 | black | |
hAlignment | int | 1..3 | center | |
vGap | num | -10000..10000 | 5 | Gap between title and items |
orientation | num | -360..+360 | 0 | Dimension:[deg] |
textWidthMax | num | -1..10000 | -1 | Dimension:[pt] |
textHeightMax | num | -1..10000 | -1 | Dimension:[pt] |
ellipsisPosition | int | 0..4 | 3 | |
shadowEffect | num[] | -1000..1000 | 0 | |
shadowColor | rgba | 0..255 | #888a |
Examples
LegendTitle("Companies")
LegendTitle("Countries\nwithout postcodes";Verdana;14;bold)
Description
By using the function LegendTitle() an optional legend title can be defined. The attributes orientation, textWidthMax, textHeightMax and ellipsisPosition are discussed in the LabelStyle() function.
| LEGEND_TITLE_01 |
1 | OpenDrawing(250;150) |
2 | ChartData(3; 4; 1) |
3 | |
4 | /* Set up styles. */ |
5 | FillStyle(3;160 160 160 220) |
6 | FillStyle(2;120 120 120 220) |
7 | FillStyle(1;200 50 50 220) |
8 | |
9 | /* Set up axes. */ |
10 | |
11 | |
12 | AxisMajorTicks(all;0) |
13 | AxisMajorTickLabelTexts(y;"") |
14 | /* Set up legend. */ |
15 | LegendTexts("Group A ";"Group B ";"Group C ") |
16 | LegendTitle("Employees";Verdana;10;bold;;;10) |
17 | /* Arrange reversed, column by column. */ |
18 | LegendOptions(centerLeft;;;-8; |
19 | -1 1 1; |
20 | ;;;;12) |
21 | /* Set up grid. */ |
22 | MajorGridLineWidths(x;y;0.25) |
23 | MajorGridLineWidths(y;x;0) |
24 |
| LEGEND_TITLE_02 |
1 | OpenDrawing(250;150) |
2 | ChartData(3 3.5 3; 1 1.5 1) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | |
7 | SymbolStyle(1;circle;6;1;121 190 51;;white) |
8 | SymbolStyle(2;circle;6;1; 48 89 195;;white) |
9 | /* Set up axes. */ |
10 | |
11 | |
12 | AxisMajorTicks(all;0) |
13 | AxisOptions(y;;2) |
14 | /* Set up legend. */ |
15 | LegendTexts("DS-1";"DS-2") |
16 | LegendTitle("Distributions";Verdana;10;bold;;;8) |
17 | LegendOptions(bottomCenter;;;;1;line+symbol;20;;;;20) |
18 | /* Set up grid. */ |
19 | MajorGridLineWidths(x;y;0.25) |
20 | MajorGridLineWidths(y;x;0) |
21 |
| LEGEND_TITLE_03 |
1 | OpenDrawing(250;150) |
2 | ChartData(100 50 15) |
3 | PieChart() |
4 | /* Set up styles. */ |
5 | |
6 | |
7 | |
8 | |
9 | /* Set up legend. */ |
10 | LegendTitle("Countries";Verdana;10;bold;;;10) |
11 | LegendTexts("Switzerland";"Norway";"Luxembourg") |
12 | |
13 | 0;0; /* hOffset and vOffset. */ |
14 | -1 1; /* Number of rows and columns. */ |
15 | automatic; /* Marker type. */ |
16 | 14;14; /* Symbol size. */ |
17 | 5; /* Gap between symbol and text. */ |
18 | 10;40; /* Gap between rows and columns. */ |
19 | bottomCenter; /* Location of legend text. */ |
20 | 2) /* Marker shape. */ |
21 |
For further information, e.g. styled texts, hyphenation, please refer to Texts.