PlotSet LogoPlotSet

How to Create a Chord Diagram

A step by step walkthrough for turning a source, target and value spreadsheet into a published chord diagram in PlotSet, from the three-column matrix to the ordering that keeps the ribbons readable.

约 9 分钟

A matrix of flows between entities is the starting point, and how to create a chord diagram in PlotSet from it, not the sample data that ships with the template, is what this guide covers. You will end up with entities arranged around a circle, ribbons sized to the amounts moving between them, and either a live embed with hover highlighting or a PNG, SVG or PDF you can drop into a deck. The click path is the same one a real PlotSet project follows from upload to publish.

If your data is already three columns, source, target and value, this takes about eight or nine minutes. Add another five if you are pulling the matrix out of a wider report or a pivot table, since that reshaping is the part people usually get stuck on before they ever open PlotSet.

你需要的数据

Three columns, one row per directed pair: source entity, target entity, and the amount flowing from source to target. Include a separate row for the reverse direction when the flows are not equal.

示例 CSV
SourceTargetGWh
NorwaySweden842
SwedenNorway613
SwedenFinland410
FinlandSweden295
SwedenDenmark378
DenmarkSweden201
DenmarkGermany530
GermanyDenmark344
NorwayDenmark156
DenmarkNorway98
备注

This is long format, not a wide matrix. If your source data looks like a grid with countries down the side and across the top, you need to unpivot it into source, target, value rows before uploading. A spreadsheet's UNPIVOT or a quick PIVOT-to-long formula handles this faster than retyping by hand.

A pair with flow in both directions needs two rows, one each way. Uploading only "Norway,Sweden,842" with nothing for the return trip renders as a one-way ribbon, which is fine if that is genuinely the case, but wrong if you just forgot the other row.

Keep the value column as plain numbers, no thousand separators and no currency symbols. A cell like "1,234" or "$1,234" sometimes imports as text rather than a number, and a text value cannot size a ribbon.

Rows where source and target are the same entity (a self-loop) do not draw a ribbon in a chord layout. Drop them before uploading rather than leaving them in as dead rows.

操作步骤

PlotSet 中从空白模板到完成图表的具体点击路径。

  1. 01

    Open the chord diagram template

    From the PlotSet dashboard, start a new project and choose the Chord Diagram template. It loads with sample data already bound, which is the fastest way to see the three-column shape, source, target, value, before you bring in your own file.

    PlotSet 的模板选择界面:左侧是图表分类列表,中间展开 Bar Charts 分类的模板网格,Bar Chart 模板卡片上显示「Select」按钮。
    每份指南都从这里开始:先选分类,再选模板,不管你要做哪种图表,用的都是同一个网格。
  2. 02

    Shape your sheet into source, target and value

    One row per directed pair. If a report gave you a wide matrix instead, with entities down the side and across the top, unpivot it into these three columns first. This is usually the slowest part of the whole process and the one worth doing carefully.

  3. 03

    Import the file or connect a sheet

    Import a CSV or .xlsx file from the data panel, paste rows directly, or connect a Google Sheet if you want the diagram to pick up new numbers later without a re-upload. PlotSet reads your first row as headers automatically.

    PlotSet 编辑器的数据视图:表格中 Name、Value、Region 三列填着加拿大各省的数据,旁边的「Data」面板提供 CSV 上传、「Magic Import」和 Google Sheet 同步。
    这里的数据视图取自一个条形图项目。你可以上传 CSV、用「Magic Import」从图片里提取数字,或同步 Google Sheet,每种图表类型的面板都一样。
  4. 04

    Map the source, target and value columns

    Confirm which column feeds each end of the ribbon and which one sets its width. PlotSet usually guesses correctly when your headers are named clearly, but check it manually if your sheet carries extra columns it might have picked up by mistake.

    PlotSet 数据面板中高亮的列绑定:「Label/time」对应 A 列,「Values」对应 B 列,「Filter/color」对应 C 列,下方是「Auto Binding」按钮。
    绑定决定哪一列作标签、哪一列提供数值、哪一列决定颜色。「Auto Binding」(自动绑定)会根据表头推测,所以要核对一遍,别想当然。
  5. 05

    Order the entities around the circle

    Drag entities in the editor so ones that trade heavily with each other sit next to each other, rather than leaving them in upload or alphabetical order. This single change does more to cut down crossing ribbons than any styling option.

  6. 06

    Aggregate anything too small to matter

    If a handful of entities carry almost no volume, group them into a single "Other" row in your source sheet before re-uploading. Thin ribbons from minor entities add visual noise without adding information, and removing them is usually what turns a knot into a readable diagram.

  7. 07

    Style the ribbons and turn on hover highlighting

    Ribbon colour is inherited from the source arc by default, which is the setting to keep so a reader can trace where a ribbon started. Turn on hover highlighting so pointing at one entity dims every ribbon except its own; this is what actually makes a dense chord diagram usable rather than decorative.

    PlotSet 编辑器停在「Preview」标签页:画布上是做好的 Chord Diagram,右侧的设置面板用红框标出。
    Chord Diagram 的「Preview」标签页。所有样式设置都在红框标出的这个面板里,每个设置各自占一个标签页:外观、标题、脚注,以及这种图表类型特有的选项。
  8. 08

    Publish the diagram, embed it, or export it

    Publish for a live, interactive diagram with the hover highlighting intact and a shareable link, grab the embed code for a page on your own site, or export a static PNG, SVG or PDF if you need an image for a report.

从已加载示例数据的 Chord Diagram 模板开始,再替换成你自己的数据。

打开模板

发布、嵌入或导出

最后一段路对每种图表都一样:「Share」(分享)把图表变成一个在线的公开链接和一段嵌入代码,「Export」(导出)把它输出成静态文件。

Share:公开链接与嵌入代码

打开嵌入代码和公开链接的开关,图表就发布出去了。链接可以放心发给任何人;嵌入代码以 iframe 的形式放进任意页面,悬停提示和交互效果都会保留。之后修改了图表,点「Recreate」就能把改动同步到链接和嵌入代码两边。

PlotSet 编辑器工具栏中高亮的「Share」按钮,紧挨着「Export」按钮。
点「Share」,完成的图表就会变成一个公开链接和一段嵌入代码。
PlotSet 的「Share」对话框:用于启用嵌入代码和公开链接的开关,「Link」「Embed」「Facebook」「Reddit」「Twitter」「LinkedIn」「Email」几个按钮,以及带「Copy」按钮的图表公开链接。
打开嵌入代码和公开链接的开关,然后复制链接或取用 iframe。之后再修改图表,点「Recreate」就能把改动同步给所有已拿到链接的人。

Export:SVG、PNG 或 JPG

「Export」会按你需要的尺寸输出一份静态副本。SVG 放到多大都清晰,还能在设计工具里继续编辑;幻灯片和文档用 PNG 或 JPG 最稳妥。想让图片在高分屏上够锐利,关键就是那个倍数设置。

PlotSet 编辑器工具栏中高亮的「Export」按钮。
要做成幻灯片或报告里的静态文件,就走「Export」这条路。
PlotSet 的「Export chart」对话框:倍数选择器设为 2x,宽高输入框填的是 1000 和 600,展开的格式菜单里列出 SVG、PNG 和 JPG。
SVG 放到多大都清晰,还能在设计工具里继续编辑;做幻灯片用 PNG 或 JPG 最稳妥。导出前先设好倍数,图片在高分屏上才够锐利。

Chord Diagram 的样式提示

Cluster before you sort

Ordering by total flow puts the busiest entities together automatically, but clustering by relationship, region, category, whatever groups things that actually trade with each other, usually cuts crossings further. Try both and keep whichever produces fewer ribbons crossing the centre.

Leave the gap between arcs alone unless it's cramped

The default spacing keeps each entity's total flow readable as an arc length. Shrinking the gap to fit more entities in usually backfires: past a point, the arcs blur into a single ring and the totals stop being legible at all.

Match your CSV's direction convention to how you read it

Decide once whether a row means "source sent to target" and stick to it across every row. Mixing conventions partway through a sheet, so one row means "exports" and the next means "imports", produces a diagram that is internally inconsistent even though every number in it is correct.

Name the aggregated bucket honestly

If you grouped a long tail of small entities into "Other", say so in the title or a caption. A reader who assumes "Other" is a real single entity will misread its arc as one busy participant rather than twelve quiet ones.

制作 Chord Diagram 时的常见错误

Every ribbon looks one-directional even though the real flows go both ways

This almost always means the sheet only had one row per pair. Check your source data for the return-direction row, Target back to Source, and add it if the underlying flow is genuinely asymmetric or reciprocal.

All the ribbons render the same width regardless of the numbers

The value column probably imported as text rather than a number, usually because a cell had a thousand separator, a currency symbol, or a trailing space. Strip formatting from the value column in your spreadsheet and re-upload.

The diagram is a solid knot of crossing ribbons

This is what happens past roughly fifteen entities, or with fewer entities left in upload order instead of clustered. Aggregate the smallest entities into an "Other" group and reorder the remaining ones so related entities sit adjacent on the circle.

深入了解 Chord Diagram

不确定 Chord Diagram 是否是正确选择?查看它是什么、何时使用以及何时不使用。

关于 Chord Diagram

Chord Diagram:常见问题

Three columns in long format: source, target and value, with one row per directed pair. If your data currently sits in a wide matrix with entities down the side and across the top, unpivot it into these three columns before uploading.

现在制作你的 Chord Diagram

免费开始,300+ 模板任选。无需信用卡。