This is the second part of a three-part series on Tableau Playbook - Area Chart. In the first part, we delved into theoretical knowledge of area chart. Check it out in case you missed it.
In this guide (Part 2), by analyzing a real-life dataset, Rossmann Store Sales, we will practice two of the typical area charts with advanced features step by step. Meanwhile, we will draw some conclusions from Tableau visualization.
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 done data wrangling and feature engineering for this dataset. You can download my version from Github for a better exploratory data analysis.
We will start with a discrete, unstacked area chart to analyze the effect of weekly promotion:
For area charts (discrete), try 1 date, 0 or more Dimensions, 1 or more Measures.
Hold down the Control key (Command key on Mac) while clicking to multiple select "Date", "Promo" and "Sales", then choose "area charts (discrete)" in Show Me. Tableau will generate a raw discrete area chart automatically.
SUM, by default. But
SUMis inappropriate here because the distribution is not balanced in promotion and non-promotion. By analyzing the distribution of sales, we can find out the data is skewed. Therefore,
MEDIANis better than
Right-click "SUM(Sales)" and choose Measure -> Median.
With the help of area, we can compare the distribution of promotion and non-promotion. We can see that Rossmann stores never promote on weekends. For weekdays, promotion performs the best on Monday. Let's deduce the possible reason. In my opinion, it may be because there is no promotion for two consecutive days and many stores choose to close on Sunday. Aided by hunger marketing, Monday's promotion is more attractive for customers who want to save money.
In this example, we want to analyze the composition of total sales grouped by different StoreType. So we will build a continuous stacked area chart with running total.
For area charts (continuous), try 1 date, 0 or more Dimensions, 1 or more Measures.
Hold down the Control key (Command key on Mac) while clicking to multiple select "Date", "StoreType", and "Sales", then choose "area charts (continuous)" in Show Me. Tableau will generate a raw continuous area chart automatically.
In this example, we drag StoreType "b" to the bottom and drag "d" to the top in color Legend.
Now, when you click on the line, you can see the specific value of the current data point. However, you may notice the values on the drop-line show the cumulative value instead of the current StoreType value (shown in the tooltip). We will learn how to fix this in the next example. That is using an unstacked version.
Unlike the line chart, the area chart shows the cumulative impact, allowing the reader to better ascertain the contribution of each StoreType to the total sales. It focuses on the part-to-whole relation. With a quick scan, we can see the total sales contribution order is b < c < d < a.
In this guide, we have learned about area charts from practice. We drew two typical area charts to demonstrate a variety of features, such as discrete vs. continuous, stacked vs. unstacked, and accumulative mode.
In the third part, we will practice another two typical area charts with a variety of advanced features.
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