Tableau is the most popular interactive data visualization tool, nowadays. It provides a wide variety of charts to explore your data easily and effectively. This series of guides - Tableau Playbook - will introduce all kinds of common charts in Tableau. And this guide will focus on Sparklines.
In this guide (Part 1), we will focus on the concepts and basic process of sparklines:
Here is a sparklines example created by Andy Kriebel from VizWiz. It uses sparklines to show the monthly taxi trips trend of different regions in Chicago. We can see the general trend of each region and analyze the statistical data at the same time. The embedded bar charts in this table can also be regarded as sparklines in a broad sense.
A sparkline is a very small line chart, typically drawn without axes or coordinates. It presents the general shape of the variation (typically over time) in some measurement in a simple and highly condensed way.
Sparklines highlight the variation instead of the absolute value. They focus on the general shape of the data. So, in most cases, truncating and non-synchronizing axes are acceptable. But remember to use them carefully. For novice users, some captions may be needed to avoid the misleading graph. Especially remember not compare sparklines if you use non-synchronized axes.
The most outstanding characteristic of sparklines is that it is extremely space-efficient. They can even be as small as one line of text and embedded into a Text Table. Sparklines also have high scalability. They are able to compact a lot of data into a small space.
Sparklines are widely used in space-sensitive scenarios, especially in the mobile UI. The typical application scenarios include stock markets, economy, business performance, and KPI dashboards.
On the other hand, since sparklines are so small, it is hard to extract numeric details. Another problem is needing to avoid misusing and misleading - what we just discussed above.
Edward described sparklines as "data-intense, design-simple, word-sized graphics". So in a broad sense, sparklines can be extended to other visual elements, such as areas, bars, and dots. We will demonstrate the extension in practice.
This dataset contains three-year sales data for 856 stores in Rossmann. Store sales are influenced by many factors, including promotions, competition, school and state holidays, seasonality, and locality.
I have already done data wrangling and feature engineering for this dataset. You can download my version from Github for a better exploratory data analysis.
As a beginning, let's draw the basic sparklines step by step:
There is no template for sparklines in Show Me, so we’ll build the raw sparklines manually:
Let's adjust the layout for a better view:
Optimize the sparklines based on the characteristics:
Put on the finishing touches:
A basic sparklines chart is now completed. But we can see that there are still many defects in this basic version. We will enhance it with advanced features in the next guide.
Due to the compactness of sparklines, they are great to show the weekday's sales trends together. Since we chose an independent axis range for each sparkline, we lose the synchronization. So we cannot compare the absolute value between weekdays. We can only compare the shape of trends: Sunday's overall trend is rather special and the rest are relatively similar.
In this guide, we have learned about a variation of the line chart in Tableau - the Sparklines.
First, we started with an example of sparklines. Then we learned the concepts and characteristics of it. Next, we learned the basic process to build a sparklines chart. In the end, we talked about other variations of the line chart.
In the second part, we will learn advanced features and extension of sparklines by practice.
You can download this example workbook Line Chart and Variations from Tableau Public.
In conclusion, I have drawn a mind map to help you organize and review the knowledge in this guide.
I hope you enjoyed it. If you have any questions, you're welcome to contact me at [email protected]
Test your skills. Learn something new. Get help. Repeat.Start a FREE 10-day trial