Skip to Content
实用 Tableau
book

实用 Tableau

by Ryan Sleeper
May 2025
Intermediate to advanced
624 pages
7h 35m
Chinese
O'Reilly Media, Inc.
Content preview from 实用 Tableau

第 36 章 如何制作甘特图 如何制作甘特图

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

甘特图传统上用于项目进度的可视化。 甘特图可以有效地说明大型业务运营背景下的任务工期和依赖关系。与使用 Tableau 构建的多种可视化一样,"Gantt Bar(甘特图条)"也是一个标记类型选项,它具有一定的灵活性,允许您以多种其他方式使用这种图表类型。 为了开始演示甘特条形图标记类型的实用性,我们将使用传统的应用构建一个甘特图来说明项目进度。最终结果如下

prta 3601

这是为数不多的无法使用 "示例 - 超级市场 "数据源进行说明的示例之一,因此我将使用以下数据集:

prta 3602

在本示例中,假设我们是一位拥有三名员工的经理,我们正在绘制他们全年十二个项目的日程表。 我们已经在 Excel 中创建了时间表,但希望利用数据可视化来:(a)更好地了解项目和员工之间的关系;(b)跟踪每个项目的完成进度;以及(c)为员工提供可视化时间表。这三个功能都可以通过甘特图来实现。

甘特图是用一个日期、一个或多个维度以及零到两个测量值创建的。日期提供了坐标轴;维度提供了我们希望可视化的细目和/或甘特图条的编码;度量创建了甘特图条的长度和/或其编码。

对于这个甘特图,我希望有一个从左到右的连续坐标轴,因此我会将日期维度(作为连续字段使用)放在列层上。查看之前显示的最终产品,项目和人员的每种组合都有行,这说明这些细分项位于行架上。 对于这种维度和度量的组合,甘特图条是 Tableau 中的默认标记类型,因此将字段放在视图上就会得到甘特图这个基础:

prta 3603

Tableau 的做法是在每个项目和人员组合的开始日期处放置一个甘特图标记。 要扩展甘特图条以说明任务持续时间,我们需要根据每个项目/人员组合的天数来确定每个标记的大小。 您可能在底层数据集中有一个工期字段,但也可以在 Tableau 中使用计算字段来创建。在这种情况下,工期就等于 [结束日期] - [开始日期]:

prta 3604

将工期放在 "尺寸标记卡 "上可以扩展甘特图标记,这样工期较长的项目/人员组合将显示较长的条形图,而工期较短的项目/人员组合将显示较短的条形图:

prta 3605

至此,我们有了一个可用的甘特图,但在 Tableau 中仍有通过格式化、编码和参考线增加很多价值的空间。 这一步可根据您自己的要求灵活掌握,但作为一个示例,我做了以下工作: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python深度学习从原理到应用

Python深度学习从原理到应用

Posts & Telecom Press, Valentino Zocca
数据科学实战手册(R+Python)(第2版)

数据科学实战手册(R+Python)(第2版)

Posts & Telecom Press, Prabhanjan Narayanachar Tattar, Tony Ojeda, Sean Patrick Murphy, Sean P Murphy, Benjamin Bengfort, Bengfort Benjamin, ABHIJIT DASGUPTA
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普
程序设计导论:Python语言实践

程序设计导论:Python语言实践

罗伯特 塞奇威克, 凯文 韦恩, 罗伯特 唐德罗

Publisher Resources

ISBN: 9798341657137