Steps 1 and 2 have been covered in Part 1 of this Recipe, where we have completed making a map which shows all the hydropower dams with different sized circles based on their capacity. For Part 2, we cover Steps 3 and 4, which guides you through creating a bar chart using custom calculations in Tableau, and connecting that chart together with the map from Part 1 into an interactive, filterable dashboard.
In this step, we will create a bar chart, which shows the combined hydropower capacity of the dams between 2009 and 2030.
By default, it will create a line graph as shown below.
Since we want to display data in a bar chart:
A bar chart will appear. You may notice the disproportionate bar chart, which is caused by the lack of construction year data for some of the hydropower plants. We will need to drop these “0” values by filtering the year.
Note: Although we have cleaned the data and created new fields in Google Sheets, we may also need to do some calculations in Tableau. In this next part, we will do some quick and easy calculations on Tableau.
This bar chart shows the cumulative amount of hydropower capacity?. Since we want to show the summation of hydropower capacity as it grows over time, we will need to do a table calculation.
First, we will adjust the color and the size of the bars.
We will be using the same color as the bubbles on the map.
We will also need to resize the bars.
Now, we will reformat map elements to make it look simple and appealing.
The following picture illustrates the steps we will take in reformatting each of the map elements.
2. Afterwards, we will remove the grid lines and axis rulers to make the chart simpler.
3. We will now edit the title, tick marks, and range of the vertical axis.
4. Let’s move on to the horizontal axis.
Note: we only need the time frame to be 2009-2030 but adding one additional year for the Fixed Start and Fixed End will make the bar chart look better. These additional years help to create some negative space around the map.
5. We will take a few extra steps to make the bar chart transparent, allowing it to overlay on the map we have created earlier. Later on, we will get to see how neat and professional a dashboard can be with worksheet transparency.
Let's take a look at the bar chart before proceeding to the next step. You will see that it features only the necessary elements, maintaining simplicity and consistency.
We will make a filterable dashboard in this step, which accurately and beautifully features the map and bar chart we created in earlier steps.
First of all, we will need to add a legend to the worksheet.
We will need to change the color of this legend to make it visible.
We will also need to modify the distribution of sizes. Tableau automatically adjusts the size of the marks to be consistent with the legend whenever you zoom in or zoom out of the map. We will need to set minimum and maximum values for the hydropower capacity data to determine the distribution of sizes for these marks.
After overlaying the bar chart on the map, we will work on the design of the bar chart. The text and ticks of the axis title are black, making it unreadable against a dark background. We will turn them white to maximize readability. Let’s start with the text.
Now we will need to change the color of the ticks.
The final map should look like below:
● Click the drop-down arrow on the right of the dashboard.
● Select Filter >Year. A filter for Year will pop up on the right top of the dashboard.
To make sure we can filter the hydropower capacity and dam locations on both the map and the bar chart, we need to follow these steps:
● Click on the drop-down menu next to the Year filter.
● Select Apply to Worksheets>All using This Data Source.
Now, in the filter, you can play with the slider – or type in the different ending years (2010/ 2015/ 2020/ 2025/ 2030) to see changes over the years.
In the original article, you can see that the marks on the map and bars on the chart pop up at a 5-year interval as you scroll down. This activity helps us see the trend of hydropower capacity over time. In the upcoming steps, we will be moving on to the Webflow to create this exciting interactive feature.