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

第 74 章 线条图 在 Tableau 中制作可爱折线图的三种方法

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

在我最喜欢的基本可视化类型中,折线图紧随条形图之后,是评估长期趋势的不二之选。 与条形图一样,折线图的发明一般归功于18世纪末的威廉-普莱费尔(William Playfair)。与条形图一样,一些数据可视化爱好者之所以寻找 "更吸引人 "的选择,我认为也是因为折线图的年代久远以及人们对折线图的熟悉程度。折线图经受住了时间的考验,其有效性毋庸置疑。我希望这三种方法有助于巩固折线图作为 Tableau 数据可视化首选的地位。

方法 1:使用 Tableau 中可用的格式设置

要使折线图更吸引人,我的第一个建议是使用 Tableau 中可用的格式选项。 请看以下使用所有 Tableau 默认格式设置的按细分市场划分的销售额折线图。请注意,我将 Month([Order Date]) 字段用作连续字段,并将数据筛选为 2016 年:

prta 7401

Tableau 的默认格式(包括字体、颜色和标记大小)花了很多心思。因此,正如我所选择的数据可视化工具所期望的那样,这个图表已经完成了工作并提供了很好的见解。尽管如此,如果您的目标之一是让图表尽可能引人入胜,那么有几个机会可以为该视图增添价值。

首先,我个人一直不喜欢连续使用日期字段时用于指定日期部分的坐标轴标题。虽然我很欣赏坐标轴标题所提供的清晰度,但这些信息通常已经隐含在图表本身中,而且通常会在上下文中加以说明(例如,"这是一个关于去年各月销售额的图表")。我几乎总是去掉这个坐标轴标题。遗憾的是,如果右键单击坐标轴并取消选择 "显示标题",坐标轴标题和月份名称都会消失。要想只去掉轴标题而保留月份名称,可以右键单击轴,然后选择编辑轴。这将打开一个对话框,您可以在其中更改坐标轴标题。诀窍是直接删除这一行的所有文本,然后单击 "确定 "按钮:

prta 7402

其次,如果这是独立的可视化效果,线条的权重就太轻了。 要改变线条的权重,请单击 "尺寸标记卡",然后向左或向右拖动滑块,直到线条的权重达到所需的程度。 我通常认为,"尺寸标记卡 "上的第二个 "凹槽 "对线条来说是个不错的选择:

prta 7403

具体情况具体分析,因为有时在狭小的空间(如仪表盘上的几个物体之一)中使用较重的线条并不美观。

下一个格式化技巧解决了我在谈论 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