Skip to Content
动手实践数据可视化
book

动手实践数据可视化

by Jack Dougherty, Ilya Ilyankou
May 2025
Intermediate to advanced
480 pages
7h 12m
Chinese
O'Reilly Media, Inc.
Content preview from 动手实践数据可视化

第 6 章 数据图表 绘制数据图表

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

图表能让读者更深入地了解你的故事。与文字或表格相比,线形图的斜率或散点图上的点群等图像能更有效地将你的证据传达给读者的眼睛。但是,要制作出有意义的图表,让我们注意到数据中的关键见解,就需要对设计选择进行清晰的思考。

在本章中,我们将在"图表设计原则 "中学习如何识别好图表和坏图表您将回顾适用于所有图表的重要规则,以及在定制自己的设计时应遵循的一些美学准则。虽然许多工具都允许您下载静态图像图表,但本书还演示了如何构建交互式图表,邀请读者在网络浏览器中探索数据。稍后,你将在第 9 章中学习如何在网站上嵌入交互式图表。

表 6-1 中了解本书中可以创建的不同类型的图表。决定图表类型主要基于两个因素:数据格式和想讲述的故事类型。例如,折线图最适合显示一系列连续的数据点(如随时间的变化),而范围图则更适合强调数据类别之间的距离(如不平等差距)。选择图表类型后,请按照我们推荐的工具和教程逐步操作。本章介绍了"Google Sheets 图表"、 "Datawrapper 图表 ""Tableau 公共图表 "中带有拖放菜单的简易工具 但是,本表也为您介绍了一些强大的工具,让您可以更轻松地自定义和托管可视化,例如第 11 章中的 Chart.js 和 Highcharts 代码模板。使用这些高级工具需要事先了解如何使用 GitHub 编辑和托管代码模板,这将在第 10 章中介绍。

备注

我们将条形图和柱形图合称为柱形图和柱状图,因为它们在 本质上是一样的,只不过条形图的方向是水平的,而柱状图的方向是垂直的。主要区别在于数据标签的长度。使用条形图显示较长的标签(如 "摩卡星冰乐 24 盎司 "和 "双四分之一磅芝士"),因为它们需要更多的水平阅读空间。对于不需要那么多空间的较短标签(如 "星巴克 "和 "麦当劳"),可以使用条形图或柱形图。你还会注意到,本章的所有例子都以食物(因为我们在写的时候真的很饿)和健康饮食(因为我们也需要减肥)为重点。

表 6-1. 基本图表类型、最佳用途和教程a
图表 本书中的最佳使用和教程

分组条形图或柱形图

image

最好是 并排比较类别。如果标签较长,可使用横条而不是竖列。

分割条形图或柱形图

image

最好在比较不同组别的类别。如果标签较长,可使用横条而不是竖列。

堆叠条形图或柱形图

最好是 比较子类别或整体的一部分。如果标签较长,可使用横条而不是竖列。

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

The Three Traps That Stymie Reinvention

The Three Traps That Stymie Reinvention

Ryan Raffaelli
The Human Factor in AI-Based Decision-Making

The Human Factor in AI-Based Decision-Making

Philip Meissner, Christoph Keding
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
Coaching for High Performance

Coaching for High Performance

MIT Sloan Management Review

Publisher Resources

ISBN: 9798341659483