1 2 Previous Next 18 Replies Latest reply on Sep 10, 2018 4:11 AM by Ahmed Mohammed

    multiple pie charts

    Lior Gil

      Hello all,

      I have 12 pie chart presented in one long line.

      in order to see them all I must stroll.

      the currrent display does not allow me to prepare a Dashboard to save as PDF or to print, since I have use the stroll to see them all.

      how can I divid the pies into 3 lines?

      (which will allow me to keep the pie size but still see them all)




        • 1. Re: multiple pie charts
          Simon Runc

          hi Lior,


          So looks like you need the Small Multiples trick!!


          So in this we create the following 4 formulas (where [Columns] is a parameter so we can choose the number of columns)








          if [RowVal]=int([RowVal]) then



              [RowVal]<0 then int([RowVal])






          IIF(([index] % [Columns])=0,[Columns],[index] % [Columns])


          Once we have all this, we can drag [Column] and [Rows] into the Column and Row shelves...and set the compute using to the dimension which is the number of Pies, which needs to be on the detail tile (in the attached example I've used SubCategory)...and Voila


          I've also added a slightly more complicated version, using some dummy axis (which I've dualled), in order to add titles.


          Hope this helps and makes sense...let me know if now

          • 2. Re: multiple pie charts
            Lior Gil

            Hi Simon,


            Thanks, look exactly like what I meant, but it shouldn't be like a matrix,

            rather like 3 rows, when each row contain: 4 pies and above each pie it's own title

            something like this:

            is it possible to create?


            Thanks again!

            • 3. Re: multiple pie charts
              Simon Runc

              hi Lior,


              So if you look at my "With Titles" tab...you can change the [Columns] parameter to change how many Pie's are on each Row, or you can just do away with the parameter altogether and hard code the number of columns you want

              Small Multiples.gif


              You can change the MIN(2.2) value to get the titles exactly where you want them.

              1 of 1 people found this helpful
              • 4. Re: multiple pie charts
                Lior Gil

                Hi Simon,


                Thanks again for the quick respond, I tried and it's still not working (not to mention I didn't under stand how you created the 1.0 and 2.2 to help you create titles)


                attached what I've done, which include all fields you have on the first tub, which ended up giving me on column and one row, so now I have all data in one pie which is worth then what I had before. 

                (I need to have for each group one pie showing the distribution by Status calculation the fee).


                any idea what I did wrong?




                • 5. Re: multiple pie charts
                  Simon Runc

                  hi Lior,


                  No probs...I can't seem to open your .twbx (seems to have got corrupted), so can you re-post it?


                  I can then get the panel set up and show you how to do the MIN(1.0)/MIN(2.2) to get a title for each pie (we need to do it this way as we can't use the Group dimension on Column/Row Shelves when we create a panel chart/small-multiples)

                  • 6. Re: multiple pie charts
                    Lior Gil

                    Yes of course, hopefully it will work this time :-)

                    • 7. Re: multiple pie charts
                      Simon Runc

                      Yes that one worked!!


                      So yes this one is bit more complicated than the version I've posted. In brief...this is due to us using index() to number the departments, and (in this case not always all 3 status' in every department...but we can get around this by using RANK_DENSE instead.


                      So we just need to switch the formula in the index() to


                      RANK_DENSE(MIN([Dept Number]),'asc') which I've called [index using RANK]


                      also notice the new field [Dept Number]...this is just


                      so we can use the Group number, so the rank goes Group 1, Group 2...Group 12...if we just use the Department Name it does it alphabetically, which is fine for numbers 1-9...but falls down for 10, 11 and 12!.


                      So once we've done this, we can add the [Row] and [Column] as before...and for each we need to set up the compute using like this



                      So now for the MIN(1.0) bit...I've set up the sheets so it explains/shows what adding each one does and then the final when we dual axis them. These are really just being used to layout the pie's and titles. As I said, we can't use the Column headers as the Department is no longer a header. I've also just typed these into the Row Shelf (we could set them up as calculated fields, but Tableau just lets you type direct into the pane - pretty cool!!)


                      So adding MIN(1.0) just does this...as every row is 1.0, it just plots them on this axis (as the point 1)



                      next I add in the MIN(2.0)...btw I've used 1.0 and 2.0 so they are floats (as opposed to integers) so we can dual axis them


                      We change the Mark Type on this axis to text and bring in the department name



                      and then when we dual-axis these (and sync axis) the text will be above each pie!!...and you can hide the headers for the Row, Column, Min(1.0) and Min(2.0) on your final version.


                      Interesting challenge, and I've learned quite a bit myself here too! (which is why I love the forums!!)


                      Let me know if anything doesn't make sense?

                      • 8. Re: multiple pie charts
                        Lior Gil


                        Thank you so much Simon for working on it, I really appreciate it, you helped me a lot !

                        • 9. Re: multiple pie charts
                          Leanne Vermeulen

                          Hi Simon Runc


                          I've used your solution for my own workbook and it works perfectly! I was wondering if you could help me work out how to add Row Headers to the Viz while still maintaining the layout? As in the image below (on the left is what I'd like; on the right is the result I get when I try):


                          Multiple Pies with Row Headers.png


                          Also, is it possible to color by each row? So pies in the top row would be one color; pies in the second row another, etc. - while still being able to "highlight" or color one pie separately to all the others (such as the black "T9" in the image above)?



                          • 10. Re: multiple pie charts
                            Simon Runc

                            hi Leanne,


                            So I've got a few options for you, depending on exactly how you want to colour them...


                            Let's start with the Role Header...So for this I made the Row and Columns discrete pills, and then I can just add the Role (as an ATTR). As an ATTR it won't affect the Row/Column table calculations (we could amend the compute using to account for the extra dimension...but why work harder!!)


                            On to the colouring....


                            So I've done 3 options...


                            Option 1 used "dummy" axis (MIN(1.0) and MIN(2.0)) to allow us to Dual Axis 2 sets of marks. One I've set to a bar (and made really big so it fills the rows). I've also set the Axis Range to 1 to 1 for both Axis. By having Bars, we can use the ATTR([Role]) to dynamically colour each row/


                            Option 3 is the same, but I've used a bigger Pie, so the pies's have coloured borders (I've also used the dummy axis MIN(1.0) and MIN(1.0)


                            Option 2 just used the inbuilt banding in Tableau (available in the format option)



                            Hope one of these does the trick!

                            1 of 1 people found this helpful
                            • 11. Re: multiple pie charts
                              Leanne Vermeulen

                              Thanks, Simon - this is awesome! I probably didn't explain properly though because Option 3 is more in line with what I was looking for (I assume a second pie acting as a border is the only solution, and that you can't change the color of the original pies per row?). Option 1 is actually also something I wanted to use elsewhere so that's also really helpful, thank you!


                              As for Role Headers, even better! Thanks a million!

                              • 12. Re: multiple pie charts
                                Leanne Vermeulen

                                Oh also, I've just tried to re-do what you suggest for the columns but the minute I convert the pills to discreet, this is what happens:




                                It completely distorts the pies?

                                • 13. Re: multiple pie charts
                                  Simon Runc

                                  Glad it was helpful...so that's just because to get the Pie's the size you wanted, when you had continuous Row/Column, you changed the size to max...if you click in the Size tile and slide the size down, all should be fine again!

                                  • 14. Re: multiple pie charts
                                    Leanne Vermeulen

                                    Haha my bad, so obvious! Thanks

                                    1 2 Previous Next