2 Replies Latest reply on Sep 4, 2013 7:13 AM by Jonathan Drummey

    Scatter plot with pie mark?

    Katy Shaw



      I'd like to build a scatter plot with one measure on the columns shelf, another measure on the rows shelf, and a third measure on the size shelf. However, I'd like the marks within the scatter plot to be a pie mark, showing how the third measure splits across a dimension.  This is very straightforward to do with the symbol maps, but I can't figure out how to do it with the scatter plots.  When I drag the dimension to the color shelf on the scatter plot, I get one symbol for each option within the dimension - one orange, one blue, one green - rather than one pie mark with different segments for those three colors.


      Any help would be greatly appreciated.




        • 1. Re: Scatter plot with pie mark?
          Joshua Milligan



          I'm afraid I don't have a good answer or even an explanation for why this behavior exists.  Interestingly, if you create a calculated field hard-coded to 1 and then use the MIN(One) on both Rows and Columns, you CAN get a pie chart.  That is of course the simplest of all scatter plots -- but why it would work in that case but not in other cases is something I don't understand.  Does anyone else have any ideas?




          1 of 1 people found this helpful
          • 2. Re: Re: Scatter plot with pie mark?
            Jonathan Drummey

            Hi Katy and Joshua,


            This is a great example for understanding how dimensions and measures affect the level of detail in the view.


            In the attached, I set up this view, the filter on Order ID just grabs the top 100 orders by SUM(Sales):


            2013-09-04 09_48_59-Tableau - pie chart scatter plot with dimensions.png


            We see 100 marks in the status bar.


            Now, when I add the Department dimension to Color, there are 164 marks and the marks have moved:


            2013-09-04 09_50_17-Tableau - pie chart scatter plot with dimensions.png


            This is because the Department dimension has increased the level of detail in the view. In SQL terms, all the dimensions in the view are added to the GROUP BY clause, and Tableau draws a mark for each tuple (aka combination of dimension values), leading to the 164 marks. The other effect of this is that Tableau is now computing the measures - Sales, Profit, Shipping Cost - based on the combination of Order ID and Department, and that changes the results.


            What we need to do is get back to a Sales for each entire Order, a Profit amount for each entire order etc. so Tableau will draw all the Department Segments of the pie in the same place and actually assemble a pie chart. Since we want Department to color the segments and have a finer level of detail, but need to generate a calculation at a coarser level of detail, table calculations come to our rescue. I set up some simple table calcs with TOTAL(SUM([Sales])), etc. and set their Compute Using to Department so they'd have the same result for each Order:


            2013-09-04 09_56_13-Tableau - pie chart scatter plot with dimensions.png


            Once that's all set up, building the view is a matter of duplicating the workout worksheet and dragging pills around:


            2013-09-04 09_57_47-Tableau - pie chart scatter plot with dimensions.png


            Note that Tableau still shows 164 marks, this is because each pie segment is a mark, Tableau assembles the pies based on all the marks in the same location. Also, if you compare the Size legends between the "starting 100 pies" and "final view" worksheets, the final view has a different legend because Tableau is computing the legend size at the Order level by summing the sizes across the Dimension. I think this is a bug, because the largest size is really 210.5, I'll send it along to Tableau tech support.


            The takeaway from this that pill awareness (what are dimensions &measures, secondarily discrete & continuous) is key to understanding what Tableau is doing.


            Hope this helps!



            1 of 1 people found this helpful