A step-by-step 'Butterfly Chart' In Tableau
This is my first blog. When I was trying to explore new charts, I came up with this interesting Butterfly Chart. Here I am going to create a Butterfly Chart by combining two Bar Charts.
What is Butterfly Chart?
A butterfly chart in Tableau is a kind 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 center, this kind of bar chart looks like the butterfly wings. Bar chart need to reverse in this case to make it like butterfly.
This is actually useful for when you are comparing something like the population of Country, State, City. For Example-Compare male gender population and female gender population of the Country, Compares previous year sales and current year sales for the same product as well as for two different products.
This Butterfly Chart in Tableau is easy to design. Now we are going to make Butterfly Chart.
'Segment wise Sales and Profit Comparision in Four years.'
Dataset: Sample Superstore.
Load Sample Superstore Dataset into tableau and follow the given steps on new Sheet.
Step 1- Select Segment and Order Date fields (Dimensions) put it on rows.
Step 2- Select Profit and Sales Fields (Measures) put it on columns.
Screenshot No. 1: Drag and drop Dimension and Measure Fields
Step 3- Sort Years in Descending Order. By Right Clicking on Years of Order date Axis and Click on Sort Descending option.
Screenshot No. 2: Sort Years in Descending Order
Step 4- Right Click on Profit Axis Select Edit Axis option.
Screenshot No.3: Edit the Axis of Profit Axis.
Step 5- Check on Reversed Check Box to get Reversed Profit Bar Chart.
Screenshot No.4: Reverse Profit Bar Chart
Step 6- Change the View from Standard to Entire View.
Screenshot No.5: Display Chart in Entire View
Step 7- Now for Bringing Segment in between the two bar charts. Create Calculated Field and Name it as ZeroLine. Click on Drop-down button of Data pane and Select Create Calculated Field Option. After Clicking OK. Get ZeroLine Calculated Field which is added on Data Pane.
Screenshot No. 6: Create Calculated Field
Step 8- Drag ZeroLine Field and Drop it exactly in between SUM(Profit) and SUM(Sales) in the Columns.
Screenshot No.7: Put Calculated Field between Profit Field and Sales Field
Step 9- Put Segment Field in Label of ZeroLine Marks.
Screenshot No.8: Put Segment Field in Label of ZeroLine Marks.
Step 10- Change the Chart type to Text from the Drop-down Option of SUM(ZeroLine) Marks. So following Changes can be seen.
Screenshot No.9: Segment labels alignment change to Center.
Step 11- By clicking on Segment Text Label, Select Format option and Change the Zero Line to None. Zero Line will get disappeared.
Screenshot No.10: Remove ZeroLine.
Step 12- Edit Label by changing Font size, Color and Make it Bold. Click on OK Button.
Screenshot No.11: Format Segment Label.
Step 13- Remove Existing Segment from the Sheet by Unchecking the option 'Show Header' of Segment Field.
Screenshot No.12: Remove Existing Segment.
Step 14- Put Profit Field on Color of SUM(Profit) Marks.
Screenshot No.13: Put Profit Field on Color of Profit Marks.
Step 15- Edit Color for Changing Wing Color of Butterfly Chart.
Screenshot No.14: Set Color to Profit Wing.
Step 16- Similarly Put Sales Field on Color of SUM(Sales)Marks.
Screenshot No.15: Put Sales Field on Color of Sales Marks.
Step 17- Edit Color for Changing Wing Color of Butterfly Chart.
Screenshot No.16: Set Color to Sales Wing.
Step 18- Right Click on ZeroLine Axis and Delete 'ZeroLine' Title and Set Major and Minor Tick Marks to None, for removing Scale Markings.
Screenshot No.17A: Remove Title 'ZeroLine'.
Screenshot No.17B: Remove Tick Marks.
Step 19- To remove Scale Markings, Right Click on Profit Axis and Set Major and Minor Tick Marks to None.
Screenshot No.18: Remove Tick Marks from Profit Axis.
Step 20- Similarly, To remove Scale Markings, Right Click on Sales Axis and Set Major and Minor Tick Marks to None.
Screenshot No.19: Remove Tick Marks from Sales Axis.
Step 21- To Add Labels on Butterfly Wing, Drag Profit Field on Labels of SUM(Profit) Marks.
Screenshot No.20: Add Label on Profit Wing.
Step 22- To Change the Alignment of Labels, Click on Label and Change alignment to Left and Set Text Bold.
Screenshot No.21: Change Alignment and Text Format of Label.
Step 23- To Add Labels on Butterfly Wing, Drag Sales Field on Labels of SUM(Sales) Marks.
Screenshot No. 22: Add Label on Sales Wing.
Step 24- To Change the Alignment of Labels, Click on Label and Change alignment to Left and Set Text Bold.
Screenshot No. 23: Change Alignment and Text Format of Label.
Step 25- Get Output- Butterfly Chart. After some detail formatting (Like removing all lines) from Sheet.
Screenshot No. 24: Output- BUTTERFLY CHART
This is the efficient, effective and easy way to compares two measures. We compared Segment wise Profit and Sales of Four different Years. In 2021, Profit and Sale were Highest for Consumer. In 2020, Profit was Highest for Corporate and In 2021, Sales was highest for Corporate. In 2021, Profit and Sale were highest for Home Office.