ChordDiagramLinkColorScheme
New in version 5.0.11
ChordDiagramLinkColorScheme ( colorScheme ; opacity )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
colorScheme | int | 1..3 | 3 | |
opacity | num | 0..1 | 0.4 |
Examples
Description
The appearance of the links can be controlled using the ChordDiagramLinkColorScheme() and ChordDiagramLinkStyle() functions. The ChordDiagramLinkColorScheme() function can be used to apply 3 special color schemes to links. If the colorScheme argument is omitted, color scheme 3 is used by default. The transparency of the colors can be controlled using the 2nd argument opacity. The opacity can be set between 0 (fully transparent) and 1 (fully opaque) — default is 0.4.
colorScheme = 1: Apply the fill color of the source nodes to the links. Not applicable when data is arranged in matrix form (see ChordDiagramData() , inputFormat = 1).
Example:
| CHORD_DIAGRAM_LINK_COLOR_SCHEME_01 |
1 | OpenDrawing(300;200) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramLinkColorScheme(1;0.25) |
5 | |
6 | ChordDiagramNodeLabel(;auto;"{NODE_ID}") |
7 | ChordDiagramNodeLabel("A";auto;"{NODE_ID}";Arial;9;bold;white) |
8 | ChordDiagramNodeLabel("B";auto;"{NODE_ID}";Arial;9;bold;white) |
9 |
colorScheme = 2: Apply the fill color of the target nodes to the links. Not applicable when data is arranged in matrix form (see ChordDiagramData() , inputFormat = 1).
Example:
| CHORD_DIAGRAM_LINK_COLOR_SCHEME_02 |
1 | OpenDrawing(300;200) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramLinkColorScheme(2;0.25) |
5 | |
6 | ChordDiagramNodeLabel(;auto;"{NODE_ID}") |
7 | ChordDiagramNodeLabel("A";auto;"{NODE_ID}";Arial;9;bold;white) |
8 | ChordDiagramNodeLabel("B";auto;"{NODE_ID}";Arial;9;bold;white) |
9 |
colorScheme = 3: Apply the color gradient between the source and target node colors to the links (default).
Examples:
| CHORD_DIAGRAM_LINK_COLOR_SCHEME_03 |
1 | OpenDrawing(300;200) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramLinkColorScheme(3;0.25) |
5 | |
6 | ChordDiagramNodeLabel(;auto;"{NODE_ID}") |
7 | ChordDiagramNodeLabel("A";auto;"{NODE_ID}";Arial;9;bold;white) |
8 | ChordDiagramNodeLabel("B";auto;"{NODE_ID}";Arial;9;bold;white) |
9 |
| CHORD_DIAGRAM_LINK_COLOR_SCHEME_04 |
1 | OpenDrawing(500;500) |
2 | ChordDiagram(label;8%;1%;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramOptions(0;0;0.6) |
4 | ChordDiagramData(2; |
5 | "Brazil" "Portugal" 5; "Brazil" "France" 1; "Brazil" "Spain" 1; "Brazil" "England" 1; "Canada" "Portugal" 1; "Canada" "France" 5; "Canada" "England" 1; "Mexico" "Portugal" 1; "Mexico" "France" 1; "Mexico" "Spain" 5; "Mexico" "England" 1; "USA" "Portugal" 1; "USA" "France" 1; "USA" "Spain" 1; "USA" "England" 5; "Portugal" "Angola" 2; "Portugal" "Senegal" 1; "Portugal" "Morocco" 1; "Portugal" "South Africa" 3; "France" "Angola" 1; "France" "Senegal" 3; "France" "Mali" 3; "France" "Morocco" 3; "France" "South Africa" 1; "Spain" "Senegal" 1; "Spain" "Morocco" 3; "Spain" "South Africa" 1; "England" "Angola" 1; "England" "Senegal" 1; "England" "Morocco" 2; "England" "South Africa" 7; "South Africa" "China" 5; "South Africa" "India" 1; "South Africa" "Japan" 3; "Angola" "China" 5; "Angola" "India" 1; "Angola" "Japan" 3; "Senegal" "China" 5; "Senegal" "India" 1; "Senegal" "Japan" 3; "Mali" "China" 5; "Mali" "India" 1; "Mali" "Japan" 3; "Morocco" "China" 5; "Morocco" "India" 1; "Morocco" "Japan" 3) |
6 | ChordDiagramLinkColorScheme(3;0.25) |
7 | |
8 | ChordDiagramNodeLabel(;auto;"{NODE_ID}";Arrial;9.5;bold;white) |
9 |
The ChordDiagramLinkColorScheme() function can be customized by using the corresponding ChordDiagramLinkStyle() function. The color scheme function should be listed before the style function(s).
| CHORD_DIAGRAM_LINK_COLOR_SCHEME_05 |
1 | OpenDrawing(550;550) |
2 | ChordDiagram(label;12;0.5%;0.5%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(1; |
4 | "Africa" 0 0 211 0 54 16 0 0 67; |
5 | "East Asia" 0 0 60 0 97 33 0 38 87; |
6 | "Europe" 211 60 0 0 0 0 0 0 0; |
7 | "Latin America" 0 0 0 0 363 0 0 0 0; |
8 | "North America" 54 97 0 363 0 0 151 0 17; |
9 | "Oceania" 16 33 0 0 0 0 35 0 0; |
10 | "South Asia" 0 0 0 0 151 35 0 0 0; |
11 | "South\nEast\nAsia" 0 38 0 0 0 0 0 0 0; |
12 | "West Asia" 67 87 0 0 17 0 0 0 0) |
13 | ChordDiagramLinkColorScheme(3;0.1) |
14 | ChordDiagramLinkStyle("Africa";;#192f8355) /* After ChordDiagramLinkColorScheme() */ |
15 | |
16 | ChordDiagramNodeLabel(;-1;"{NODE_ID}";Arial;8) |
17 |
Note that ChordDiagramLinkColorScheme() should be listed after the ChordDiagram() function. This rule generally applies: The ChordDiagram() function should always be listed first, before other chord functions are called.