PlotSet LogoPlotSet

How to Create a Dumbbell Chart

A step by step walkthrough for turning two columns of before and after numbers into a published dumbbell chart in PlotSet, from shaping the sheet to exporting or embedding the result.

约 7 分钟

Two dots per category, joined by a line: that is how to create a dumbbell chart from your own spreadsheet, sorted by the size of the change and coloured so a reader can tell which dot is which, and either embedded on a page or exported as an image. Not a demo with placeholder rows, your own categories and your own two numbers, run through the same click path a published PlotSet chart takes.

If your data is already three columns, category and two values, this takes about seven minutes. Add a few more if your numbers are currently spread across two separate rows per category (a long format export) rather than sitting side by side, since that is the one reshape a dumbbell chart actually forces on you before it will draw a connector at all.

你需要的数据

Three columns, one row per category: the category name, the first value, the second value. No separate rows for each value, one header row, and the two value column headers become the legend labels for the two dots.

示例 CSV
CountryLife Expectancy 2000Life Expectancy 2023
Japan81.284.1
United States76.679.3
Brazil70.175.6
Russia65.572.7
India62.670.8
Nigeria46.862.6
备注

Both values live on the same row. If your export has one row per country per year, a long or tidy format, pivot it into wide format first: one row per country, one column per year. PlotSet cannot pair rows across a stacked layout on its own.

Name the two value columns clearly, for example the actual years or state names rather than "Value 1" and "Value 2". PlotSet uses those header names for the dot legend, and vague headers make a vague legend.

Keep both value columns numeric. If either one has a stray unit, a percent sign or a currency symbol typed into the cell, PlotSet reads it as text and drops the row from the chart instead of plotting it.

A blank cell in either value column means that category has no second dot to connect. Fill it in with the real number or remove the row rather than leaving a half-drawn pair.

操作步骤

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

  1. 01

    Open the dumbbell chart template

    From the PlotSet dashboard, start a new project and choose the Dumbbell Chart template, listed under connected dots. It loads with sample data already bound so you can see the exact three column layout before touching your own file.

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

    Shape your sheet into category, value one, value two

    One row per category, with both numbers on that same row. If you exported from a database or a BI tool, check now whether it came out long (one row per category per period) and pivot it wide before moving on.

  3. 03

    Upload the file, or connect it live

    Import a CSV or .xlsx file from the data panel, paste rows straight from a spreadsheet, or connect a Google Sheet so the chart can be refreshed later without a re-upload. PlotSet reads the first row as your column headers.

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

    Map the category and two value columns

    Confirm which column feeds the category axis and which two feed the pair of dots. This is usually correct automatically when your headers are clear; check it by hand if your sheet carries extra columns PlotSet had to guess between.

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

    Sort by the size of the gap

    Switch the sort from alphabetical to sort by difference, descending. This is the step that actually makes the chart useful: it turns a list of categories into a ranking of where the change was biggest, which is usually the real question your reader has.

  6. 06

    Colour the two dots and pick a connector style

    Give the first value and the second value clearly different colours, since telling the pair apart is the first thing a reader needs to do. If some categories rose while others fell, colour the connector by direction too, or a mixed chart reads as if everything moved the same way.

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

    Add gap labels and set the value axis

    Turn on the difference label at the end of each connector so the exact change is readable without measuring. The value axis does not need to start at zero here, dots encode position rather than length, so you can trim it to the actual range of your data to make small gaps in large numbers visible.

  8. 08

    Publish it, embed it, or export the pairs

    Publish for a live, interactive chart where hovering a pair shows both values and the difference, grab the embed code for a page, or export a PNG, SVG or PDF if you need a static image for a deck.

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

打开模板

发布、嵌入或导出

最后一段路对每种图表都一样:「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 最稳妥。导出前先设好倍数,图片在高分屏上才够锐利。

Dumbbell Chart 的样式提示

Label the first and last row directly

A legend tells the reader which colour is which, but putting the actual value names, for example the two years, next to the top pair of dots means most readers never have to look for the legend at all.

Colour by direction when it flips

If some categories increased and others decreased, use one colour for connectors that went up and a second for connectors that went down. Otherwise a reader assumes every pair moved the same way, and about half the chart gets misread.

Trim the axis, but say so

Starting the value axis near your lowest value rather than at zero is normal for a dumbbell chart and makes small differences legible. If the range is genuinely tight, add a line in the caption noting the axis does not start at zero, since a reader skimming fast can otherwise misjudge scale.

Cap it around thirty categories

A dumbbell chart holds far more rows than a grouped bar chart before it gets unreadable, but past roughly thirty pairs the connectors start to blur together. Filter to the categories with the largest gaps and note in the title that it is a subset.

制作 Dumbbell Chart 时的常见错误

The chart shows single dots with no connecting line

This almost always means the second value column came in as text rather than a number, often from a stray percent sign or currency symbol in a cell. Check the column's data type in PlotSet's data table and clean the raw values in your source sheet.

Both dots in every pair are the same colour

PlotSet defaulted the two value columns to a single series colour. Open the styling panel and assign the first and second value distinct colours, since a single colour turns the chart into an unlabelled range instead of a comparison.

The pairs will not line up after uploading

The source data is in long format, one row per category per value, instead of wide format with both values on the same row. Pivot the sheet so each category appears exactly once with two value columns, then re-upload.

深入了解 Dumbbell Chart

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

关于 Dumbbell Chart

Dumbbell Chart:常见问题

Three columns and one header row: the category name, then two numeric value columns on the same row, such as a 2000 figure and a 2023 figure for each country. Long format data with a separate row per value needs to be pivoted wide first.

现在制作你的 Dumbbell Chart

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