Chapter 9 Table Your Data

You might be surprised that a data visualization book which emphasizes charts and maps also includes a chapter on creating tables. We don’t normally think about data tables as a type of visualization. But depending on your data and the story you wish to tell about it, sometimes a table is the most appropriate way to present information, especially when it’s an interactive table on the web. Tables make sense when readers want to look up a specific row of data that’s highly relevant to them, such as their local community or an organization they belong to, which can be too hard to identify inside a large chart or map. Also, tables work best when readers wish to precisely compare individual values to one another, but not necessarily to the rest of the dataset. Finally, tables work better than charts when there is no broad visual pattern to emphasize, and work better than maps when there is no particular spatial pattern. Before you start designing a chart or map, consider whether it makes more sense to create a table instead. Sometimes the best visualization is simply a good table.

TODO: Break this out into two separate sections and place in the body of the chapter, before Datawrapper?

Of course, you can create tables with spreadsheet tools. For example, with Google Sheets you can format rows and columns of data, and download the table as a static PDF image that you can place in a document, or convert into a PNG or JPG image to easily insert on a web page. Sometimes this simple approach makes sense. Also, you can use the spreadsheet pivot table feature in Chapter 3 to create a more sophisticated cross-tabulation, and export it as an image to insert in a document or website. With Google Sheets, you can can also publish any of your tables online, and embed them on a web page as we’ll discuss in Chapter 10, so that whenever you update your Google Sheet, the current data will automatically appear on the web page. Furthermore, you can also use Tableau Public, a tool we previously introduced in Chapter 7 and Chapter 8 to create a highlight table, which automatically colors the backgrounds of cells to draw your eye to higher versus lower values.

In this chapter, we’ll focus on creating interactive tables, which have many advantages over static tables when publishing your information online, rather than only in print. First, interactive tables allow readers to search by keyword for specific details that interest them, which is vital when you present long tables with lots of rows. Second, readers can sort interactive tables in ascending or descending order for any column, which enables them to quickly scan those near the top or bottom of a long list. Finally, you’ll also learn how to insert sparklines, or tiny charts that visually summarize data trends in each row, and automatically place them inside your interactive table. Sparklines blend the best qualities of tables and charts by making it easier for readers to visually scan for trends while skimming down the rows and columns of your data table. Later in Chapter 10: Embed on the Web, you’ll learn how to integrate your interactive table into your website.

In this chapter, you’ll learn about table design principles and how to use Datawrapper, a tool we introduced in Chapter 7: Chart Your Data and Chapter 8: Map Your Data to create an interactive table with sparklines.