4 Replies Latest reply on Aug 6, 2014 12:03 PM by Mercy Joseph

    Custom Shapes: Stacked bar graph?

    Dave Ulliott

      Hey guys,

      I've not had a chance to try this out for myself yet, but I was wondering if anybody knows if this is possible?

      I want to produce a bar graph, representing the volume of virtual fruits purchased within an online game. Volume along the Y axis, fruits arrayed along the x axis ('Apple', 'Orange', 'Cherry' etc)

      I was wondering if it is possible to use custom shapes within Tableau to represent a bar chart? Ideally stacking the image, rather than stretching it.

      So, say we had sold 5 apples, 10 oranges and 40 cherries, the graph would have Volume on Y, Fruit Names on X, and the bars would be stacked images on the corresponding fruit.

      What do you think?

      Dave

        • 1. Re: Custom Shapes: Stacked bar graph?
          Tracy Rodgers

          Hi Dave,

           

          You can do this by first, importing the desired custom shapes (http://onlinehelp.tableausoftware.com/current/pro/online/en-us/buildmanual_shelves_shape_custom.html

           

          Then, change the Mark type to shape. Place your fruit dimension on the Columns shelf and the shape shelf. Place your value on the rows shelf. Then, go to Analysis and un-check Aggregate Measures.

           

          Hope this helps!

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: Custom Shapes: Stacked bar graph?
            Dave Ulliott

            Hey Tracy!

            First of all, apologies that it has taken so long for me to get back to you.

            Thank you very much for your help - this looks to me like it would work a dream.

            HOWEVER. I've recently managed to get my hands on the data, and it's structured in a way that makes this solution not quite work.

            The Fruit dimension is actually a concatenated string, containing text indicators for the fruit purchased in a transaction. Example:

            Ingredient:"Fruit_Apple,Fruit_Orange,Fruit_Cherry"

            Ingredient:"Fruit_Apple,Fruit_Banana"

            etc

             

            So, I've built multiple calculated fields in order to ascertain whether or not each fruit type appears in the string.

             

            "IF FIND([Ingredients],"apple") >0 THEN 1 ELSE 0 END"

            "IF FIND([Ingredients],"orange") >0 THEN 1 ELSE 0 END"

             

            (there's probably a cleaner way to look for a string within a string, but this jumped out at me)

             

            Using the Measure Values on the Rows shelf, and Measure Names on the Columns Shelf (filtering out 'Number of Records', of course) leaves me with more or less what I'm after. The only issue is that, because I am now only using 1 Data Item ("Measure Values"), I am only able to assign one shape to the whole dataset.

             

            Apologies for not posting a packaged workbook, this is sensitive data and I've not had a chance to clean it. Will do, if nobody can think of any obvious solutions.

             



            • 3. Re: Custom Shapes: Stacked bar graph?
              Dave Ulliott

              Just realised what I was missing... Just need to bring the Measure Names pill in for the Shape parameter and bobs my uncle.

              Silly me!

              • 4. Re: Custom Shapes: Stacked bar graph?
                Mercy Joseph

                Hi Tracy -

                Just to follow up on this question - is there a way to reaggregate the shape counts, so that they say if you had 1 million fruits (to go along with the OP's example) you would only have say 10 fruit shapes showing??

                Must be re-calculated ? Or perhaps reformatted? I will play around with it and see.

                Thanks