11 Replies Latest reply on Oct 20, 2016 11:00 PM by t.c.4

    Shapes and words inside a cell

    Diogo Braga

      I am trying to make the visual on the left (tableau workbook attached) look similar to the image on the right. In other words, I want the shape to be on the far left without any words on top of it.

       

      2016-05-31_1513.png2016-05-31_1512.png

        • 1. Re: Shapes and words inside a cell
          Nicholas Hara

          Hi Diogo, I helped out a customer a long time ago with a very similar issue. You may have to make a few modifications to make it fit your needs:


          Step 1: Create the View
          1. Create a calculated field "Blank Field" with formula 0
          2. Add Status to the Colors shelf
          3. Change the graph type to Shape
          4. Ctrl + Drag Trend Arrow to the Shape shelf

          Step 2: Offset the Shapes
          1. Add the Blank Field to the columns shelf (repeat by ctrl + dragging)
          2. Right-click on the second Blank Field and select Dual Axis
          3. In the Marks card on the second Blank Field, change the graph type to text
          4. Right-click on the top axis and fix the range to -4 and 3
          5. Right-click on the bottom axis and fix the range to -1 and 5

          Step 3: Format
          1. Right-click on each Blank Field in the view and deselect Show Header
          2. Right-click on a cell and select Format
          3. Select the brush and change the Zero Lines to None
          4. Edit the colors and shapes as desired.

          3 of 3 people found this helpful
          • 2. Re: Shapes and words inside a cell
            Joe Oppelt

            Yeah, I struggle with this too.

             

            Maybe this isn't the BEST way to handle it, but this works for me.

             

            I make a dual-axis sheet using the same measure.  (In your case you don't have a measure on the sheet, so I just created a bogus measure: [100].)

             

            When you have dual axis, you can manage each mark separately.  So in the attached I got you half way there.

             

            You'll see one of the marks is using the label as you designed it.  (Except I left-justified it.)  The label is coming out on a bar that I made "invisible" by choosing color = white, and size=0 and no border.  The bar is there, but you can't see it.

             

            The second mark is your shape.

             

            Now here's the problem.  Tableau wants to center the shape.  So you still have the issue you raised here.  But if you were to pick custom shapes, you could make the jpeg push the actual shape to the left of the picture.  I just didn't want to take the time to do that myself.

             

            I see one other problem here.  Select School=B in your filter.  Tableau is reacting to the very long status value for "Ceilings" here.  So you'll want to look at that.

             

            My point here is to show you a way (and again, maybe not the best way, so I'll watch for other ideas to pop up here) to manage multiple considerations for the piece of data you want to display in a given cell.

             

            (Note to self.  Workbook = v9.3)

            1 of 1 people found this helpful
            • 3. Re: Shapes and words inside a cell
              Joshua Preston

              Does your solution apply to my case? Workbook attached. Thanks!

               

              The alignment of this row of shapes and labels is a like a zigzag. I would expect them to align in a straight line. Is there any way to assess what's causing this and fix it? Workbook attached.

               

              1 of 1 people found this helpful
              • 4. Re: Shapes and words inside a cell
                Nicholas Hara

                Hey Joshua,

                 

                After taking a quick browse on your workbook, the solution should absolutely work.

                 

                Try out the steps, it seems like a lot, but they go by pretty fast.

                 

                Reply here if you get stuck at all.

                 

                Good luck!

                1 of 1 people found this helpful
                • 5. Re: Shapes and words inside a cell
                  Joe Oppelt

                  Your zig-zag is because you have right-justified your labels.  The END of the longest label in the first row will line up with the END of the longest label in the second row.  Etc.  The zig-zag is because labels are different sizes, so they "reach" more (or less) to the left than other rows.  Left-justify your labels and follow Nicholas' very detailed instructions.

                  2 of 2 people found this helpful
                  • 6. Re: Shapes and words inside a cell
                    Joshua Preston

                    So close! thanks for the detailed steps. (I didn't have to do step 1 since I already had the shapes.) I get close here, but the alignment of the Labels is still askew. You can see the second Blank Field Measure on the Dual Axis was turned to text (per your instructions). I changed the axis to *fixed* with ranges that got the shape and text close. But no matter what alignment options I pick, the text won't behave like true column. NOTE: The images are not the same sizes, but even when I changed the Shape to the default Tableau X's and O's shapes (which have the same dimensions), the text is still not aligned. Thanks for the help.

                     

                     

                    Screenshot and workbook attached.

                     

                    2 of 2 people found this helpful
                    • 7. Re: Shapes and words inside a cell
                      Joshua Preston

                      I figured it out! The measure helped make the alignment happen. Thanks again for the helping me get here.

                       

                      Without the measure:

                       

                       

                       

                      With the Blank Field measure:

                       

                      1 of 1 people found this helpful
                      • 8. Re: Shapes and words inside a cell
                        Diogo Braga

                        This solution worked for me. Now I have an additional question related to this thread here: Wrap text with shape inside a cell

                        • 9. Re: Shapes and words inside a cell
                          Diogo Braga

                          Joshua, can you share your workbook from your last reply? I think that will help me.

                          • 10. Re: Shapes and words inside a cell
                            Joshua Preston

                            Here you go. This is a worksheet with a small file size. (I can't attach but here's the link: | Tableau Public )

                            • 11. Re: Shapes and words inside a cell
                              t.c.4

                              Thank you , Nicholas Hara, for your encouragement "it seems like a lot, but they go by pretty fast"!  It looked daunting and I gave it a go and lo and behold, it really works!  It's a lot of steps for what should be more simple - we're forced to be be magicians.