|
| 1 | +{{ target: series-chord }} |
| 2 | + |
| 3 | +# series.chord(Object) |
| 4 | + |
| 5 | +{{ use: partial-version( |
| 6 | + version = "6.0.0" |
| 7 | +) }} |
| 8 | + |
| 9 | +A chord diagram is a chart used to visualize relationships and flows between different entities. It displays the direction and proportion of data flows with elegant arcs and chords. |
| 10 | + |
| 11 | +**Example:** |
| 12 | + |
| 13 | +~[600x600](${galleryViewPath}chord-style&edit=1&reset=1) |
| 14 | + |
| 15 | + |
| 16 | +<ExampleBaseOption name="chord" title="Basic Chord" title-en="Basic Chord"> |
| 17 | +const option = { |
| 18 | + tooltip: {}, |
| 19 | + legend: {}, |
| 20 | + series: [ |
| 21 | + { |
| 22 | + type: 'chord', |
| 23 | + clockwise: false, |
| 24 | + label: { show: true }, |
| 25 | + lineStyle: { color: 'target' }, |
| 26 | + data: [{ name: 'A' }, { name: 'B' }, { name: 'C' }, { name: 'D' }], |
| 27 | + links: [ |
| 28 | + { source: 'A', target: 'B', value: 40 }, |
| 29 | + { source: 'A', target: 'C', value: 20 }, |
| 30 | + { source: 'B', target: 'D', value: 20 } |
| 31 | + ] |
| 32 | + } |
| 33 | + ] |
| 34 | +}; |
| 35 | +</ExampleBaseOption> |
| 36 | + |
| 37 | +## type(string) = 'chord' |
| 38 | + |
| 39 | +{{ use: partial-component-id( |
| 40 | + prefix = "#" |
| 41 | +) }} |
| 42 | + |
| 43 | +{{ use: partial-series-name() }} |
| 44 | + |
| 45 | +{{ use: component-circular-layout( |
| 46 | + componentName = "Chord Diagram", |
| 47 | + defaultRadius = "['70%', '80%']" |
| 48 | +) }} |
| 49 | + |
| 50 | +## clockwise(boolean) = true |
| 51 | + |
| 52 | +<ExampleUIControlBoolean default="true" /> |
| 53 | + |
| 54 | +Whether the sectors are arranged clockwise. |
| 55 | + |
| 56 | +## startAngle(number) = 90 |
| 57 | + |
| 58 | +<ExampleUIControlAngle step="1" min="0" max="360" default="90" /> |
| 59 | + |
| 60 | +Starting angle, supported range [0, 360]. |
| 61 | + |
| 62 | +## minAngle(number) = 0 |
| 63 | + |
| 64 | +<ExampleUIControlAngle step="1" min="0" max="360" default="0" /> |
| 65 | + |
| 66 | +Minimum sector angle (0 ~ 360), used to prevent very small values from producing sectors that are too small and affect interaction. |
| 67 | + |
| 68 | +~[600x600](${galleryViewPath}chord-minAngle&edit=1&reset=1) |
| 69 | + |
| 70 | +## padAngle(number) = 0 |
| 71 | + |
| 72 | +<ExampleUIControlAngle step="1" min="0" max="360" default="0" /> |
| 73 | + |
| 74 | +The gap angle between sectors (0 ~ 360). |
| 75 | + |
| 76 | +{{ use: partial-coord-sys( |
| 77 | + version = '6.0.0', |
| 78 | + seriesType = "chord", |
| 79 | + coordSysDefault = "'none'", |
| 80 | + calendar = true, |
| 81 | + matrix = true, |
| 82 | + none = true |
| 83 | +) }} |
| 84 | + |
| 85 | +## itemStyle(Object) |
| 86 | + |
| 87 | +{{ use: partial-item-style-desc() }} |
| 88 | + |
| 89 | +{{ use: partial-item-style( |
| 90 | + prefix = "##", |
| 91 | + useColorPalatte = true, |
| 92 | + hasCallback = true, |
| 93 | + useDecal = true |
| 94 | +) }} |
| 95 | + |
| 96 | +{{ use: partial-sector-border-radius( |
| 97 | + prefix = '##', |
| 98 | + type = "Chord Diagram" |
| 99 | +) }} |
| 100 | + |
| 101 | +## lineStyle(Object) |
| 102 | + |
| 103 | +### color(string) = 'source' |
| 104 | + |
| 105 | +The color of the edge in Chord charts. |
| 106 | + |
| 107 | ++ `'source'`: use source node color. |
| 108 | ++ `'target'`: use target node color. |
| 109 | ++ `'gradient'`: gradient color between source node and target node. |
| 110 | + |
| 111 | +~[900x500](${galleryViewPath}chord-lineStyle-color&edit=1&reset=1) |
| 112 | + |
| 113 | +### opacity(number) = ${defaultOpacity|default(0.2)} |
| 114 | + |
| 115 | +Opacity of the edges. |
| 116 | + |
| 117 | +{{ use: partial-style-shadow( |
| 118 | + prefix = '##' |
| 119 | +) }} |
| 120 | + |
| 121 | +## data(Array) |
| 122 | + |
| 123 | +List of node data for the chord diagram. |
| 124 | + |
| 125 | +```ts |
| 126 | +data: [{ |
| 127 | + name: 'A' |
| 128 | +}, { |
| 129 | + name: 'B', |
| 130 | + value: 100 |
| 131 | +}, { |
| 132 | + name: 'C', |
| 133 | + itemStyle: { |
| 134 | + color: 'red' |
| 135 | + } |
| 136 | +}] |
| 137 | +``` |
| 138 | + |
| 139 | +Note: The node `name` must be unique. |
| 140 | + |
| 141 | +### name(string) |
| 142 | + |
| 143 | +Name of the data item. |
| 144 | + |
| 145 | +### value(number|Array) |
| 146 | + |
| 147 | +Value of the data item. |
| 148 | + |
| 149 | +### itemStyle(Object) |
| 150 | + |
| 151 | +Style of this node. |
| 152 | + |
| 153 | +{{ use: partial-item-style( |
| 154 | + prefix = "###", |
| 155 | + useColorPalatte = true |
| 156 | +) }} |
| 157 | + |
| 158 | +### label(Object) |
| 159 | + |
| 160 | +Label style for this node. |
| 161 | + |
| 162 | +{{ use: partial-label( |
| 163 | + prefix = "###", |
| 164 | + labelMargin = true, |
| 165 | + noPosition = true |
| 166 | +) }} |
| 167 | + |
| 168 | +#### position(string) |
| 169 | + |
| 170 | +Position of the label. Supports `'inside'` or `'outside'`. |
| 171 | + |
| 172 | +### emphasis(Object) |
| 173 | + |
| 174 | +Style when the node is emphasized. |
| 175 | + |
| 176 | +{{ use: partial-emphasis-disabled( |
| 177 | + prefix = "###" |
| 178 | +) }} |
| 179 | + |
| 180 | +{{ use: graph-node-state( |
| 181 | + state = 'emphasis' |
| 182 | +) }} |
| 183 | + |
| 184 | +### blur(Object) |
| 185 | + |
| 186 | +{{ use: partial-version( |
| 187 | + version = "5.0.0" |
| 188 | +) }} |
| 189 | + |
| 190 | +The blur (faded) state of the node. |
| 191 | + |
| 192 | +{{ use: graph-node-state( |
| 193 | + state = 'blur' |
| 194 | +) }} |
| 195 | + |
| 196 | +### select(Object) |
| 197 | + |
| 198 | +{{ use: partial-version( |
| 199 | + version = "5.0.0" |
| 200 | +) }} |
| 201 | + |
| 202 | +The selected state of the node. |
| 203 | + |
| 204 | +{{ use: partial-select-disabled( |
| 205 | + prefix = "###" |
| 206 | +) }} |
| 207 | + |
| 208 | +{{ use: graph-node-state( |
| 209 | + state = 'select' |
| 210 | +) }} |
| 211 | + |
| 212 | +{{ use: partial-tooltip-in-series-data() }} |
| 213 | + |
| 214 | +## nodes(Array) |
| 215 | + |
| 216 | +Alias, same as [data](~series-graph.data) |
| 217 | + |
| 218 | +## links(Array) |
| 219 | + |
| 220 | +Relationship data between nodes. Example: |
| 221 | +```ts |
| 222 | +links: [{ |
| 223 | + source: 'n1', |
| 224 | + target: 'n2' |
| 225 | +}, { |
| 226 | + source: 'n2', |
| 227 | + target: 'n3' |
| 228 | +}] |
| 229 | +``` |
| 230 | + |
| 231 | +### source(string|number) |
| 232 | + |
| 233 | +The source node name ([data.name](~series-graph.data.name)) as a string, or the index of the source node as a number. |
| 234 | + |
| 235 | +### target(string|number) |
| 236 | + |
| 237 | +The target node name ([data.name](~series-graph.data.name)) as a string, or the index of the target node as a number. |
| 238 | + |
| 239 | +### value(number) |
| 240 | + |
| 241 | +Value of the edge. |
| 242 | + |
| 243 | +## emphasis(Object) |
| 244 | + |
| 245 | +Styles for emphasized sectors and labels. |
| 246 | + |
| 247 | +{{ use: partial-emphasis-disabled( |
| 248 | + prefix = "##" |
| 249 | +) }} |
| 250 | + |
| 251 | +{{ use: partial-focus-blur-scope() }} |
0 commit comments