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

第 44 章 如何制作动态双轴凹凸图 如何制作动态双轴凹凸图

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

凹凸图是显示维度成员在不同时间段内的排名情况的有效方法。 例如,您可能想了解特定产品类别在贵公司不同年份的销售排名情况。或者,您可能想使用离散月份作为时间元素,查看产品类别的排名是否会因季节性而发生变化。又或者,您想做一些工作之外的事情,看看您的梦幻足球运动员在不同的统计数据中每周的排名如何!

不管是什么情况,我都发现凹凸图是一种引人入胜、易于理解的可视化排名随时间变化的方法。 Tableau Zen 大师马特-钱伯斯(Matt Chambers)用凹凸图创建了今年最受欢迎的 Tableau 公共可视化之一,并在他的网站Sir Viz-a-Lot 上提供了他的技术。

除了引人入胜、易于理解之外,这种图表类型在 Tableau 中的制作也非常简单。

本教程将向您介绍如何在 Tableau 中制作凹凸图,还将介绍如何利用双轴在视图上提供额外的上下文,以及如何让最终用户选择被排序的度量和被比较的维度成员。

如何在 Tableau 中制作凹凸图

在教程的第一部分,我们将重新创建这个凹凸 图表,显示样本 - 超级市场数据集的细分市场在 1 月和 12 月间的 SUM(销售额)指标排名情况:

prta 4401

要创建凹凸图,首先要将要评估的时间元素放到列架上。为了重新创建如图所示的凹凸图,我在列架上放置了离散的 MONTH(订单日期)。我想指出的是,由于选择了月份日期部分,而且我在这里使用的数据集有四年的数据,因此十二个月中的每个月都将有四年的数据汇总在一起。我这样做是为了说明问题,但如果您要使用这种图表类型来显示随时间的变化,请确保您选择的日期最适合您的分析。

在 "措施 "架上,我将为我们要进行排名的措施放置一个计算字段;在本例中是销售额。计算字段的公式是 RANK(SUM(Sales))。此时,视图如下:

prta 4402

在 Tableau 中,RANK 函数就像表格计算一样,因此当它被添加到视图中时, ,它是在整个表格中从左到右进行计算的。 要按 "分段 "维度对销售金额进行排序,我们可以将 "分段 "维度拖到 "颜色标记卡 "上,使视图的详细程度更加细化:

prta 4403

这样我们就更接近目标了,但我们仍然需要更改 RANK 表的计算方法,以便对每个分段进行计算。销售排名测量值上的 delta 符号告诉我们正在进行表格计算。要编辑表格计算的方式,请右键单击销售排名测量值,将鼠标悬停在 "使用计算 "上,然后选择 "分段":

此时,从技术上讲,我们已经在 Tableau 中得到了一个凹凸图。最好的排名(即 1)放在最上面可能更直观,因此我将右键单击销售排名轴,单击编辑轴,然后选中反转比例复选框,从而反转坐标轴: ...

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