ChordDiagramData

New in version 5.0.11

ChordDiagramData ( inputFormat ;​ data1 ;​ data2 ;​ . . . ;​ data1000 )

Argument Type Range Default Note
inputFormat int 1..3 (required)
data1 str (required)
data2 str (required)
... str (required)
data1000 str (required)
Examples

ChordDiagramData(1;​"A" 0 3 0 1 5 0 0 0 1;​"B" 3 0 0 2 0 0 0 0 0;​...)

ChordDiagramData(2;​"A" "B" 3.85;​"A" "Z" 1.25;​...)

ChordDiagramData(3;​"A" "B" "C" "D";​0 1 3.85;​0 2 1.25;​1 3 1.55;​...)

Description

Data for chord diagrams can be transferred to xmCHART using the function ChordDiagramData(). Three input formats are available for this. The input format can be controlled with the 1st argument inputFormat.

inputFormat =​ 1:
The data is arranged in matrix form, with each row representing a node and its outgoing links. The link matrix must be symmetric with a diagonal value of 0.

CHORD_DIAGRAM_DATA_01
1

OpenDrawing(450;​450)

2

ChordDiagram(label) /* 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.25)

14

ChordDiagramNodeColorScheme(5)

15

ChordDiagramNodeLabel(;​-1;​"{NODE_ID}")

16

CloseDrawing()

CHORD_DIAGRAM_DATA_01

inputFormat =​ 2:
The data is arranged in a series of link definitions separated by a semicolon ";". Each link is defined by 3 values, i.e. the source ID of the link, the target ID of the link and the link value (weight).

CHORD_DIAGRAM_DATA_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

ChordDiagramNodeStyle(;​orange)

5

ChordDiagramNodeLabel(;​auto;​"{NODE_ID}")

6

CloseDrawing()

CHORD_DIAGRAM_DATA_02

inputFormat =​ 3:
A list of all node IDs is passed as the 2nd argument to the ChordDiagramData() function. The following 3rd, 4th, ... arguments contain the link definitions. Each link is defined by 3 values, i.e. the index of the source node ID, the index of the target node ID and the link value (weight). Note that the indices start at 0.

CHORD_DIAGRAM_DATA_03
1

OpenDrawing(300;​200)

2

ChordDiagram(label;​16;​3;​1%) /* Function ChordDiagram(...) is always listed first. */

3

ChordDiagramData(3;​"A" "B" "X" "Y" "Z";​ 0 2 5;​ 0 3 7;​ 0 4 6;​ 1 2 2;​ 1 3 9;​ 1 4 4)

4

ChordDiagramNodeStyle(;​orange)

5

ChordDiagramNodeLabel(;​auto;​"{NODE_ID}")

6

CloseDrawing()

CHORD_DIAGRAM_DATA_03

Note that ChordDiagramData() 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.

Scroll to Top