1. Building impressive charts
Let’s learn some new exciting charts, starting with a variation of the yummy waffle chart - the chocolate chart.
Next to our main dataset of the Eurovision song contest, we need a template that creates a matrix of columns and rows, adding up to 100%. In the waffle case, that’s a ten by ten, and in the chocolate case, we will have five rows and 20 columns.
For now, these datasets aren’t connected, but we will change that with a new calculation. It’s important that we do this calculation in the chocolate dataset, as Tableau can then blend the data correctly.
Let’s call it Colored boxes: it will compare the average song danceability to the summed percentage from the chocolate dataset.
Let’s drop it to the color, change the visualization to heat maps and remove the percentage from the size marks card.
We will change the colors to grey and brown to create a bar of proper chocolate, and we’ll hide the headers.
Let’s resize it a bit and add the annotation to it. We want to know the song’s average danceability so let’s add it first from the Eurovision dataset to the detail.
Now we will click anywhere on the chart to annotate Mark.
And we will only keep that one measure, increasing the size.
And here is our chocolate chart! A perfect replacement for a pie chart or a stacked bar chart.
Ready for a DNA chart now?
We will study songs’ energy levels per country. We start by dropping the individual countries into the rows and building a bar chart of the minimum song’s energy by dropping it into columns. We also need the song’s average energy, but this time we will use Tableau’s secret shortcut, dropping the second measure here.
Tableau draws two measures as a bar chart and automatically places two handy pills on columns and rows: Measure Values and Names.
If we now move the Measure Names to the Color and change the Marks to circles, we obtain what starts to look like a DNA chart.
Let’s sort it from high to low.
We still need the bars between the dots. We will drop the average song energy once again to the columns and change the chart type to Gantt Bar on that mark.
Next, we will calculate the length of the bar. We do so by making an ad hoc calculation by double-clicking here. It will be the difference between the blue dot, so average energy, and the orange dot, the minimum energy.
Let’s place it on the size mark, merge the charts by applying dual-axis and synchronize them.
Hmm, the bar goes in the wrong direction! To correct that, we simply add the negative sign to the measure.
With a final stroke, we reduce the size of the bar and remove the measure name from the color.
And here is our DNA chart!
Now onto the sparklines; let’s try the bar chart version! We start by building a simple bar chart of average song liveliness by region and year.
We will remove the headers on the Year and the measure.
And make it a bit smaller.
Finally, we will accentuate the maximum points per Region by dropping a precalculated measure, Peak liveliness, onto Color.
This measure compares the average song liveliness per region to the window maximum of that measure.
And here is our sparkline chart. We immediately see that while former socialist countries had their peak a long time ago, Western Europe seems to head in the opposite direction!
Now over to you - try it out for yourself in the exercises!
2. Let's practice!