3 Replies Latest reply on Jun 23, 2016 11:36 AM by Simon Runc

    Creating a Lollipop/Pie Combo chart

    Stuart Dunlap

      Hi,

       

      I know I'm violating a visual best practice, but it's difficult to resist the possible opportunity of combining lollipops and pie all in the same chart! 

       

      I'm trying to create a lollipop chart, but the twist is for the head of the lollipop, I would like to have a pie chart instead of the traditional circle mark.  Is this possible?

       

      Attached is my attempt at doing this.  The first worksheet called 'Bottom of Lollipop (Bar Chart)' and it has the base of the lollipop.  The second worksheet called 'Top of Lollipop (Pie Chart)' has the pie chart I want to use for the top of the lollipop.  The last two sheets are my attempt to bring it all together.  The issue appears to be related to the secondary axis, which prevents the pie chart from getting created... but I'm not sure if that's correct.

       

      Does anyone have any ideas for doing this?  I would like to keep this in one worksheet view as opposed to creating a dashboard to make this work.

       

      Stuart

        • 1. Re: Creating a Lollipop/Pie Combo chart
          Simon Runc

          hi Stuart,

           

          ...with the above caveats that this is a 'train-wreck' of a visualization!!...I will answer this as it demonstrates some key concepts in Tableau!!

           

          The issue is coming 2 fold...you have a different Axis for you Bars and Pies...which is why they won't line up when you dual/sync the axis. Green Pills create Axis, and Blue Pills headers...so used in this way you are using the second axis to 'place' the pies. The second problem is that when you bring your Margin Bin onto the colour shelf, this is adding to the vizLoD (i.e. creating extra marks, one per bin) and so you get a pie per one, and not all in one pie. Hope that makes sense...here is my fave all time article on the subject of pills...Blue things and Green things - The Information Lab

           

          So what we need to do, is to create the 'placing' of the pies axis as a single value for each pie. We can do this with a Table Calculation (which are aggregates of aggregates).

           

          So I create a calculated field (to use as a 'placing' axis...that will only return the SUM of Profit for each pie, and not one per Profit Bin)

          [Profit - Window Sum]

          WINDOW_SUM(SUM([Profit]))

           

          I bring this into the column shelf (as the Axis) and set compute using to Profit Bin

           

           

          Then we can proceed as per your original...I've also added this to the Pie and Bar (just using SUM of Profit) Sizes (btw we get no pie for tables as it's negative profit)

           

          Hope that makes sense, but please post back if not and I can go into a bit more detail...Take the learning from this (actually quite a good example for demonstrating VizLoD and Green Pils), but please refrain from actually doing it!!

           

          ...right off to take a viz-shower...to clean all the bad viz off

          3 of 3 people found this helpful
          • 2. Re: Creating a Lollipop/Pie Combo chart
            Stuart Dunlap

            Well Simon, the deed has been done and the train is officially wrecked. 

             

            I was able to recreate your example for the view I was working on and your direction was great.  Thank you for your reply!  Also, thanks for the reference to the article on Blue things and Green things, I thought I had my arms around those concepts but the blog had very helpful detail.  (and it was nice to take a trip down memory lane with the Tableau 7 interface)

             

            Even if I don't use the viz, your reply turned out to be a helpful Tableau learning exercise.

             

            Stuart

            • 3. Re: Creating a Lollipop/Pie Combo chart
              Simon Runc

              Excellent news!

               

              Yes although that article was written back in 2011, it is (IMHO) what makes Tableau, Tableau!...so is still fundamental to everything Tableau today!...I do a bit of training, and probably spend around 1/3 of my time just on this concept...once people get that green pills create axis (allowing you to 'place' marks where you want), and blue pills create headers, allowing you to 'pane' those axis. The mark type then determines how you want that mark to look/act...and in a nutshell, that is Tableau (very simple, very flexible). Once you have this, then creating anything you can imagine is just a case of arranging these 3 things (+ the detail [detail/colour/size...etc.] tells Tableau how many of these marks you want)....even a pie-chart lollipop