1 2 Previous Next 17 Replies Latest reply on Feb 17, 2020 7:11 PM by George Taguchi

    How to make a stacked donut chart

    Alice Woo

      Does anyone happen to know how I can recreate the exact donut chart below but with a different set of data?





      I am looking for the ability to create and stack multiple donut charts on top of each other to show and compare percentages. I find that it's difficult to create donut chart alones (lots of manipulation and manual additions) Does anyone have any recommendations? Any help is appreciated, thank you!

        • 1. Re: How to make a stacked donut chart
          Derrick Austin

          Hey Alice,


          You'll have fun creating this one in Tableau. The donut usually uses a dual axis, but you can only do that 2 layers deep.


          You might check out the bullet chart posted on VizWiz as a starting point: Dear Data Two | Week 35: Getting Dressed


          If you want an easier chart, but still donuts - may I suggest a chart I call "The Maple Longjohn"?

          It's like the original donut, but longer, instead of circular - and without a hole in the middle.

          Best of all - it is very Tableau friendly.


          8 of 9 people found this helpful
          • 2. Re: How to make a stacked donut chart
            Michael Daddona



            Please see the attached workbook.  While it is not 100% matching, I'm hoping this solution will take you far enough that you can play around with formatting and employ some more techniques to reach your final solution.


            You can stack pie charts in Tableau, since we can plot them along the X axis, then adjust the axis to be so large the relative positions of the data points over lap.


            I created these X values and made them specific to each region so each region would have it's on pie chart along the axis. I also created a size variable so each chart would be sized slightly less than the next.  The 2 variables have an inverse relationship so they overlap.


            Feel free to review and let me know if you have any other questions.




            13 of 13 people found this helpful
            • 3. Re: How to make a stacked donut chart
              Dustin Brickwood



              I have tried to replicate Michaels beautifully created stacked doughnut charts and I cannot seem to get it right. Could you provide a step by step by any chance as it seems recreating the sampled workbook is not working for me.



              • 4. Re: How to make a stacked donut chart
                Dustin Brickwood

                Also is there any way to have each region its own color that still represents the difference between the percentage and the remainder?

                • 6. Re: How to make a stacked donut chart
                  Kirill Frolov

                  Hello, Mike!

                  I was very helped by your decision, thank you. But I have a question about coloring the bands inside the chart. For example, if I have the most in North America, then it should be highlighted in green, and all the others in red?



                  • 7. Re: How to make a stacked donut chart
                    Alex Tankou

                    Hello Michael and all ,


                    million thanks for your donut chart Michael Daddona !! How can I change the position of the labels so that they seat more closely inside their relevant circle? So something similar to the chart below?


                    For my graph, I want to use absolute values as opposed to percentage values, how can I add absolute value labels  on both of the uncolored and the colored parts of each donuts ring?





                    Attached is what I have so far using my own data.


                    Thank you so much in advance for assisting me !

                    • 8. Re: How to make a stacked donut chart
                      Juhn Mer

                      Hello Michael,


                      I am in need of a visual that looks like this, but I have only two donuts to stack. I have Yes and No perce,tages to show, would you kindly share the steps on how to produce this dashboard. What are bigness and ramainder in your data source? is 25 always 25? the formula in X, I will just leave that? I believe Level is just to determine the order of stacking, is that correct?


                      Apologies for many questions.


                      Thanks so much in advance.

                      • 9. Re: How to make a stacked donut chart
                        Ong Shengda

                        What is the remainder suppose to be, is there a formula for it?

                        • 10. Re: How to make a stacked donut chart
                          Michael Daddona


                          I actually have an example that works perfectly for this.  See my tableau public workbook below, and follow these steps, you can also use this to create multiples.



                          For this example I used a simple data set and 2 measures for common segments.


                          We need two create two pie charts stacked on top of each other:

                          Create [Pie ID]

                          Assign ID’s to each metric level (segment) , in this data we have 2.

                          if [Action] = "Returned" then 1 elseif [Action] = "Sold" then 2 END

                          Create measure [One] which is just the number 1, this will be a constant between all pies to keep them within the same axis.

                          We will then create measures that are specific to the actions that we want.  In this data I want percent of totals for the individual measures.  There are many ways to do this so use which best suits your data.

                          I created several metrics based on the percent of total, I then use the Pie ID to create one metric for each level, for example:

                          IF ATTR([Pie ID]) = 1 then [Percent of Returned] elseif ATTR([Pie ID]) = 2 then [Percent of Sold] END

                          This allows me to create 1 remainder but 2 metrics:

                          1-[Action Metric]


                          Now, using [PIE Id] we can begin to stack our pie charts.

                          Drag Pie ID onto your columns shelf and choose Pie as your chart type.  You will see 2 pie charts begin to appear:


                          Next, drag your measure values onto your angle, and measure names onto your colors.  Depending on how you built your measures you will start to see the colors change correctly with the associated [PIE ID].

                          Make sure your [Pie ID] is a dimension measure (green pill but no aggregates).

                          To obtain the overlap effect, you want to change you axis to be extreme negative and extreme positive.  Such as -10000 to 10000, this will force to pie charts to appear on top of each other.

                          Next, drag [ONE] to your rows column and choose average, this will center all instances of your pie.


                          The next step will be to size the chart to our liking.   I created a metric called [Pie Size], this is used to determine the size of the pie based on the level/metric/segment you are using.  My formula was this:

                          ifnull(if [Action] = "Returned" then 1.25 ELSEIF [Action] = "Sold" then 2 END,2)

                          This was to incorporate and actions I wasn’t using in this table.  Also, you want to go from small to large from left to right, as the left most pie will be foremost. Drop [Pie Size] onto your size, and adjust the size slider to make the chart larger.  Remember to make [Pie Size] a dimension measure.


                          Your pie chart may look different at this point, as the remainder metric depending on how you built them make already be showing.  I want to create multiple versions of this across my Manufacture dimension, so until I filter or add this attribute in, I will show 100% for both of my measures.

                          Okay, so lets add our hole to our doughnut.

                          Pull [One] to your column shelf, make it a dimension measure, create a dual axis, sync your axis, strip out the elements and give it the color of white:


                          You made a doughnut, good job.

                          I like to add borders to my colors so that there is definition between the bars.  Now I drag my Manufacturer dimension onto the table and get multiple charts instantly.

                          I play around with cell sizes, clean out grid lines, field labels and headers.


                          And I add in my label on my hole chart ([ONE]).  Drop it into a dashboard and adjust some layout settings:


                          You can also create groups and add them to arrange your charts similar to below:

                          1 of 1 people found this helpful
                          • 11. Re: How to make a stacked donut chart
                            Michael Daddona



                            Please see my reply to Juhn Mer above, you can use the following workbook to see more detail about the formulas if needed:



                            • 12. Re: How to make a stacked donut chart
                              Juhn Mer

                              Thank you so much. That explains is more. I found your workbook prior to your reply, but even then, i can't replicate. I will try i again now that you have explained it in more details.


                              Thanks so much for your time, Michael.

                              • 13. Re: How to make a stacked donut chart
                                sudheerbabu mandalapu

                                Hi All,


                                am also trying the similar type of doughnut chart( Doughnut within doughnut) but am getting like below,how we can make them into single doughnut. Could you please let me know the trics how to achive this, please share the step by step if possible.

                                • 14. Re: How to make a stacked donut chart
                                  Peter Fakan

                                  Hi Sudheerbabu,


                                  Refer to this solution How to create a doughnut chart inside a doughnut chart?





                                  1 of 1 people found this helpful
                                  1 2 Previous Next