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

第 52 章 在 Tableau 中绘制饼图的三种替代方法

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

尽管饼图是最无效的数据交流方式之一,但我还是经常在企业仪表盘和 Tableau 公共可视化中看到饼图。 新用户很可能将饼图视为美化仪表盘的简单方法,但这对他们自己却是一种伤害,因为饼图会增加洞察时间--这与我们试图通过数据可视化实现的目标恰恰相反。

当我分享饼图的缺点时,通常会有人问我:"但如果我不能使用饼图,那我该如何显示整体关系的一部分呢?为此,我想记录下在 Tableau 中使用饼图的更好方法。

Tableau 为什么首先允许绘制饼图?

您可能会想,既然饼图这么糟糕,为什么 Tableau 还允许您使用 "显示我 "或将标记类型更改为饼图?

在 Tableau 中首次引入饼图时,它们的特定用途是作为填充地图上的辅助标记类型。 您可能已经看过 Tableau 的这个示例,他们使用饼图显示了美国各州按类别划分的销售额:

prta 5201

在此示例中,填充地图上的颜色代表各州的总销售额,饼图用于显示各州总销售额的构成。在这种情况下,使用饼作为辅助标记类型是实现此视图的唯一方法。

虽然 Tableau 的初衷是好的,但它推出这种标记类型却让人大跌眼镜。实际上,我从未在实际仪表盘中见过这种预期用途,但用户却以多种超出最佳实践的方式使用饼图。在本章中,我将与大家分享几种饼图的替代方法,同时向大家推荐一种可视化整体关系中的部分关系的方法。

Tableau 饼图替代方案 #1:条形图

如果必须在 Tableau 工作簿中使用饼图,我有两条原则。第一条是使用五个或更少的切片。 更重要的是,饼图绝不能用于时间序列分析。因此,我的第一个饼状图替代方案是使用条形图,条形图是比较某一时间点数值的最佳选择。

与我们刚才看的地图相比,这种方法有一点不足,那就是无法快速比较各州之间的情况。不过,你可以使用仪表盘操作来实现类似的功能,当点击或悬停在某个州上时,条形图就会更新。我喜欢这种方法,因为这样可以增加实际销售数字和/或每个类别所占整体比例:

prta 5202

Tableau 饼图替代方案 #2:堆叠条形图或区域图

Tableau 的另一种饼图替代方法是使用堆叠条形图。我不太喜欢这种替代方法,因为除非堆叠条形图位于底部,否则很难比较整个视图中各个堆叠条形图的趋势。但这仍然比饼图好。 在 Tableau 中很容易将条形图转换为堆叠条形图,只需将创建每个条形图的维度从行或列架上移到颜色标记卡上即可。在堆叠条形图中,最高条形的顶部代表总数,下面的每种颜色代表对总数的贡献。例如,请看下面的条形图:

prta 5203

现在来看一下以堆叠条形图形式显示的相同数据:

无论是柱形图还是堆叠柱形图,其数值都是一个时间点的数值。对我来说,这些图表类型没有太大价值,因为它们在企业仪表盘中很快就会过时。例如,条形图很可能每周或每月都不会发生变化。即使发生了变化,由于您查看的始终是一个时间点,因此也无法与之前的时间框架进行比较。 ...

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