A butterfly chart in Tableau is a type of bar chart used to compare two data sets at a time. This chart plots the data as two horizontal bars with the same X-axis in the centre, this kind of bar chart resembling the butterfly wings. Bar chart need to reverse in this case to make bar as resemble of butterfly. This Butterfly Chart in Tableau is easy to design
How can revere bar?
Double-click the axis that you want to edit. You can also right-click the axis, and then select Edit Axis. In the Edit Axis dialog box, select Reversed the axis scale.
This butterfly graph is significate for data like comparison of Gender graph, comparison of salary between the countries of age group, population for age group etc.
Below are the dataset used for the butterfly graph
Red mark measures as calculated fields and below are the calculated formula which has been used for this
Female Count
Count(If [Gender]=”F” then [Gender] END)
Male Count
Count(If [Gender]=”M” then [Gender] END)
Zero Axis
0 // Comment keep zero only
Steps:
- First step to drag country in rows and Female Count & Male Count into columns. You will see the left side red box that specify two separate text as Agg(Female Count) and Agg(Male Count). Where you can change the chart type, colours etc…, you will see in next steps
- Drag the zero axis twice next to Female and Male count, and you will se zero axis box at left side in Marks area
- Now, right click on zero axis and convert the Zero axis into Dual axis.
- After converting zero axis as dual axis then synchronize the axis so that Zero and Female & male count will be on same level
- Then right click on Female and male axis > click on edit axis
- And select Reversed check box
- You will se small female bar as reversed bar graph as seen below screenshot, now you need to reduce the circle with option in Mark area for zero axis
- Then change the zero axis setting for Zero axis as as fixed from 0 to automatic
- Now you can change the colour of bar for female as pink to make difference between both graph
- Finally drag the count of Employee or you can drag count of Female and Male for each box in Marks area
So, the Butterfly Graph in Tableau easy to design.
Watch Video guide:
Below are the few more chart can be created in tableau, steps wise guide for easy to design.