This is the third blog in the Tableau charts series where we explore different charts offered by Tableau. In the previous blogs we discussed Area charts, Tree Maps and Bubble charts in detail, today, we will learn how to make Pie charts, Doughnut Charts, and Scatter plots.
You can check out the previous blog here.
Let's start!
Customary message:
Again, we will be using the Superstore dataset. Although it is already available in Tableau please download it from below here since some changes have been made to it for the purpose of this tutorial.
Now load the data into tableau and navigate to the workspace.
Pie Charts
A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion.
In a pie chart, the arc length of each slice, is proportional to the quantity it represents.
They can be used to show percentages of a whole, and represents percentages at a set point in time.
There are two ways to a build a chart in Tableau. You can either do it by using the 'Show Me' option or you can build the chart from scratch.
To build a pie chart from scratch follow these steps:
Select the 'Pie' option from the dropdown menu on the Marks card.
Drag the 'Category' field onto the 'Color' option on the Marks card. ( change the fit to entire view for better visualization). You can also change the color scheme of the chart using the 'edit' option
You will notice that instead of the 'Shape' option there is now 'Angle' option on the Marks card. This option is used to set the size of each portion according to sum measure. So, we will drag 'Sales' field to the 'Angle' option. This will adjust the size of each part of the Pie chart according to the Sales made by each category.
Now, all that left is adding labels, to do that you just need to drag the desired fields to the 'Label' option on the Marks card.
All the above steps are shown below.
In the above chart, if you want to show the sales as a percentage instead of total then you can do so by using the 'Quick Table Calculations' in the dropdown menu of the 'Sales' field which corresponds to Labels (highlighted in green) on the Marks card and then selecting the 'Percent of Total' option.
Alternatively, you can also build the same graph using the 'Show Me' option as shown below.
Doughnut Charts
It is a variation of a Pie chart, the only difference is that it has a round hole in the center which makes it look like a donut, hence the name.
This empty space can be used to display additional data.
This type of chart is not offered in the 'Show Me' tab and making this chart is a bit tricky, but worry not we will get through this. The process of making a doughnut chart involves making two copies of a pie chart, making them concentric and then making one of them blank.
The steps to make a doughnut chart are as follows:
------------------------------------------STEP 1------------------------------------------------
To do this you first have to make a single pie chart as shown above. When you have your pie chart you need to drag the 'Number of records' measure to the row shelf. You need to perform this step twice.
After that you have to change the aggregate function of 'Number of records' from 'sum' to 'minimum' as shown below.
We now have two exactly same pie-charts.
------------------------------------------STEP 2------------------------------------------------
In the row shelf select one of the field, open it's dropdown menu and select the ' Dual axis option'. This will make the two pie charts concentric.
You can adjust the size of both the pie charts for better visualization.
------------------------------------------STEP 3------------------------------------------------
In this step we make one of the pie chart blank.
To do this:
We select one of the dropdown menu corresponding to a pie chart on the Marks card.
We then remove all the labels, angles and colors by dragging them out of the card.
We color the pie chart white and decrease it's size.
We now have a doughnut chart.
You can adjust the size of both the pie charts to increase/decrease the size of the doughnut chart.
Scatter plots
A scatter plot is a chart type that is normally used to observe and visually display the relationship between variables.
Scatter plots make use of Cartesian coordinates to display the values of the variables in a data set.
The values of the variables are represented by dots.
To make a scatter plot we will need at least two measures without aggregate functions on them. We will make a scatter plot showing the relationship between sales and profit.
Steps to a scatterplot:
Step 1: Drag the 'Sales' field to the columns shelf and the 'Profit' field to the rows shelf.
Step 2: Remove the aggregate function of these fields by selecting 'Dimension' in their dropdown menu or by de-selecting 'Aggregate measures' in the Analysis tab.
You have your scatter plot.
To add more detail you can show different categories of product with different color and shape by dragging the 'Category' field to the Color and Shape option on the marks card.
To be one step ahead, you can add custom shapes to your plot as well.
For that you need to download the desired images and add them to the 'shapes' folder in the 'my Tableau Repository' folder.
Let's try it!
We will be adding custom shapes for the three categories: furniture, office supplies and technology. I will be using the images shown below.
Store the pictures in a folder ( I have named the folder as 'Category') and copy the folder.
Then go to Documents >> My Tableau Repository >> shapes and paste the folder there.
One important step is to go to Shapes option on marks card and press the 'Reload shapes button'.
If you will now try to edit the shape, in the dropdown menu you will find the folder that you added above.
You can now map the images in this folder to the desired category type and that's it. You just added custom images to your plot. But before doing that you should remove the color scheme by dragging out the 'Category' field corresponding to color scheme on the marks card.
The final result is shown below.
You are always advised to explore Tableau yourself, get your hands dirty with it as much as you can, that way you will learn more. All the best for your adventure and stay tuned for the next blog.
You maybe interested to check out the following blogs:
If you need implementation for any of the topics mentioned above or assignment help on any of its variants, feel free to contact us.
Comments