Total Pageviews

Thursday, 20 July 2023

5.2 Stacked Bars (Tableau)

 

5.2 Stacked Bars

Scatterplots aren’t the only way to show multiple quantities in the same view. Another visualization type we can use is the stacked bar chart. Let’s create a stacked bar chart as we explore a different angle of the data:  per game rates.

Rate is a ratio in which the numerator and the denominator have different units. Rates that are per game have the number of games played as the denominator

The data table doesn’t include the per game rates, so we’ll have to create them using calculated fields We’ll create Goals per Game, Assists per Game, and Points per Game by right-clicking in the Dimensions or Measures area, selecting Create Calculated Field, and then filling out the dialog boxes similar to the one shown as follows.


Uploading: 130313 of 130313 bytes uploaded.

Now that we have these three new calculated fields in our Measures area, we can use them to visualize the rate of point production as a stacked bar plot.

Steps to create Stacked Bar:

1. Drag Player Id to the Rows shelf, creating an alphabetical list of player names.

2. Drag Measure Values from the Measures area to the Columns shelf, creating bars that are the sum of all Measures for each player.

3. Drag Measure Names from the Dimensions area to the Colors shelf, breaking up the bars by color.

4. Drag everything except AGG(Assists per Game) and AGG(Goals per Game) out of the Measure Values area below the Marks card, which leaves only two corresponding bars for each player.

5. Change the colors by clicking on the down arrow to the right of the Measure Names area header and clicking Edit Colors.

6. Click the down arrow in the blue Player pill on the Rows shelf and select Sort, choosing a descending sort order by the Points per Game field.



To do some changes from the stacked bar to the dual dot chart plot, simply change the Marks type from Automatic, or bars, to Circles or Shapes, whichever you prefer



No comments:

Post a Comment