TreeMap
TreeMap ( appearanceConst )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
appearanceConst | int | 0..127 | default |
Description
The 1st argument appearance makes it possible to add shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) to the map. Appearance options can be combined by using a plus sign "+".
| TREE_MAP_01 |
1 | OpenDrawing(300;150) |
2 | ChartData(10 1 13 5 12 3 9 18 15 14 4 20 19 17 11 6 16 7 8 2) |
3 | |
4 | /* Set up styles. */ |
5 | |
6 | BorderStyle(all;;0.25;black) |
7 |
| TREE_MAP_02 |
1 | OpenDrawing(400;160) |
2 | ChartData(15 16 2 16 15 5 3 11 2 2; |
3 | 20 19 1 1 7) |
4 | |
5 | TreeMapOptions(1.5%) /* After TreeMap() */ |
6 | /* Set up styles. */ |
7 | |
8 | BorderStyle(all;;0.5;0 0 0 30) |
9 | LabelStyle(1;Verdana;10;plain;#fff) |
10 | LabelStyle(2;Verdana;10;plain;#333) |
11 |
| TREE_MAP_03 |
1 | OpenDrawing(400;200) |
2 | |
3 | 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) |
4 | |
5 | TreeMapOptions(;;on) /* optimizeLabelTextColor = on */ |
6 | /* Set up styles. */ |
7 | FillColorScale(1;-18;;0.75) |
8 | BorderStyle(all;;1;#aaa) |
9 | LabelStyle(all;Arial;9) |
10 | |
11 |
| TREE_MAP_04 |
1 | OpenDrawing(400;160) |
2 | ChartData(10 4 5 2; |
3 | 6 16 7 8 2; |
4 | 5) |
5 | |
6 | TreeMapOptions(1.25%; /* subdomainGap */ |
7 | 1; /* distributionFlag */ |
8 | on) /* optimizeLabelTextColor */ |
9 | /* Set up styles. */ |
10 | BorderStyle(all;;1.0;0 0 0 80) |
11 | FillColorScheme(11;shaded) |
12 | LabelOptions(all;bottomRight;-1;-1) |
13 |
| TREE_MAP_05 |
1 | /* Tree map with color scale. */ |
2 | OpenDrawing(450;350) |
3 | ChartData(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 6 14 0 2 4 7 10 13 16 18 20 20 19 18 16 13 10 7; |
4 | 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; |
5 | 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 1 3 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) |
6 | TreeMap() |
7 | TreeMapOptions(1%) /* After TreeMap() */ |
8 | /* Set up styles. */ |
9 | FillColorScale(1;11;shaded) |
10 | FillColorScale(2;4;shaded) |
11 | FillColorScale(3;12;shaded;;4) /* 4 color tones. */ |
12 | |
13 |
| TREE_MAP_06 |
1 | OpenDrawing(360;230) |
2 | |
3 | ChartData(14 8 1 10 1 12 17 11 5 3 16 12 8 11 9 8 5 7 19 3 17 6 2 18 13 15 1 19 10 1 13 20 10 15 9 20 2 17 20 20) |
4 | TreeMap() |
5 | FillColorScale(1;15) |
6 | BorderStyle(1;;1;#666) |
7 | |
8 | |
9 | ChartData(1 12 10 12 5 1 5 11 7 11 13 5 2 6 13 6 15 3 6 11 4 6 2 13 3 1 1 4 4 19 3 1 13 7 9 8 3 4 5 14) |
10 | TreeMap() |
11 | FillColorScale(1;15) |
12 | BorderStyle(1;;1;#666) |
13 | |
14 | |
15 | ChartData(7 9 2 11 1 6 2 4 7 3 1 1 8 5 6 5 6 13 2 19 11 7 6 3 1 3 5 10 3 4 7 15 14 5 12 2 4 4 1 1) |
16 | TreeMap() |
17 | FillColorScale(1;15) |
18 | BorderStyle(1;;1;#666) |
19 | |
20 | AddText(10; 45;"Distribution A";Arial;14;plain;#444;left;center) |
21 | AddText(10;115;"Distribution B";Arial;14;plain;#444;left;center) |
22 | AddText(10;185;"Distribution C";Arial;14;plain;#444;left;center) |
23 | AddText(310; 45;"428";Arial;20;plain;#444;left;center) |
24 | AddText(240;115;"279";Arial;20;plain;#444;left;center) |
25 | AddText(220;185;"236";Arial;20;plain;#444;left;center) |
26 |
Starting with xmCHART 5 labels can show absolute and relative (percent) values. For example:
| TREE_MAP_07 |
1 | OpenDrawing(460;250) |
2 | ChartData(10 1 13 5 12 3 9 18 15 14 4 20 19 17 11 6 16 7 8 2) |
3 | |
4 | /* Set up styles. */ |
5 | FillColorScale(1;-10;0;0.15) |
6 | BorderStyle(all;;1;#aaa) |
7 | LabelStyle(all;Arial;8;bold;#555;center) |
8 | LabelTexts(all;"A |u|\n(|f1|%)"; |
9 | "B |u|\n(|f1|%)"; |
10 | "C |u|\n(|f1|%)"; |
11 | "D |u|\n(|f1|%)"; |
12 | "E |u|\n(|f1|%)"; |
13 | "F |u|\n(|f1|%)"; |
14 | "G |u|\n(|f1|%)"; |
15 | "H |u|\n(|f1|%)"; |
16 | "I |u|\n(|f1|%)"; |
17 | "J |u|\n(|f1|%)"; |
18 | "K |u|\n(|f1|%)"; |
19 | "L |u|\n(|f1|%)"; |
20 | "M |u|\n(|f1|%)"; |
21 | "N |u|\n(|f1|%)"; |
22 | "O |u|\n(|f1|%)"; |
23 | "P |u|\n(|f1|%)"; |
24 | "Q |u|\n(|f1|%)"; |
25 | "R |u|\n(|f1|%)"; |
26 | "S |u|\n(|f1|%)"; |
27 | "T |u|\n(|f1|%)") |
28 |
See also functions LegendColorScale() and LegendColorTones() .
For more examples, please refer to Color Scales.