1 2 Previous Next 15 Replies Latest reply on Dec 30, 2015 11:14 AM by Joe Oppelt

    Ideas for equal-sized bars from sheet to sheet.

    Joe Oppelt

      I have a bunch of bullet charts.  (For the record, they are horizontal, and the bottom bar is thinner than the top, by design.)

       

      I want to make the fat bars in all the sheets the same thickness from sheet to sheet, and I want to make the thinner bars in each sheet the same thickness from sheet to sheet.  Likewise I want to make the sheets all the identical size.

       

      Attached workbook simulates something like what I have (only I have dozens of these sheets in real life.)

       

      Copy Formatting doesn't help -- at least the way I'm using it.

       

      If only the size slider would give me some sort of numerical value that I can make consistent from sheet to sheet, that would take care of my needs.


      Any ideas?

        • 1. Re: Ideas for equal-sized bars from sheet to sheet.
          pooja.gandhi

          Hey Joe!

           

          One way to do this could be to place 'discrete' sum(number of records) on the size shelf of the first axis in every sheet and nothing on size on the second axis. The size slider should be pulled all the way to the right on both the axes. This will make sure you have identically sized 1st and 2nd axis on every sheet, provided you have number of records on all sheets from the same data source.

           

          Screen Shot 2015-12-28 at 11.36.30 AM.png

          Screen Shot 2015-12-28 at 11.36.00 AM.png

          • 2. Re: Ideas for equal-sized bars from sheet to sheet.
            Shawn Wallwork

            I took a slightly different approach than Pooja...

             

            1. On all sheets move the size slider all the way to the right
            2. Then in each sheet drop the Measure Name field on the Size shelf for All Mark shelves (both axis).
            3. Float the sheets on the dashboard directly (not within a container)
            4. Set Fit to Entire view
            5. Make the two sheets the exact same size
            6. Put them side-by-side and line up the horizontal axis borders exactly, so the axis spaces are the same (note in a dual axis both top & bottom adjust at the same time).

            Here's the result:

            You'll note that the pink bar is 2-3 pixels smaller, but I think that has to do with the Axis borders not being perfectly aligned (which is difficult to do). But hopefully that's close enough. Let me know what version you are using (it's not 9.2) and I can post a workbook for you.

             

            --Shawn

             

            EDIT: To get the right bar to be the big one, you'll have to Edit the Size legend and use Reversed:

            • 3. Re: Ideas for equal-sized bars from sheet to sheet.
              Joe Oppelt

              Pooja, Shawn --

               

              First Shawn -- Maybe floating these will be smarter than putting them in a container.  This thing is going to have to scroll because of the number of these charts.  It's a front page dashboard with a pile of these sheets.  Each one is a high-level view, and each will have drill-downs to its own dashboard for details.  Today there are 16 high level sheets.  Over time even more will likely be added.  I just threw them in a container for ... I don't know why.  Well, actually, yes ... having them stacked in a container lets me control the width of them all uniformly, but that's noise, really.  I can set them one by one through the size coordinates easily enough.    The dashboard will scroll whether or not the sheets are in a container...  So I'll look at that.  AND, the axis headers will not be displayed, so that complication will not impact me.

               

              Pooja -- I hadn't thought about putting a value on size.  I was sliding the slider to get the width.  However I don't want Tableau picking the widths for me.  I want to select them.  After a bunch of wrangling and visual hair-splitting, the sales/profit bars in the attached updated workbook are the approximate proportions and fonts we've settled on.  (And it's not really sales and profits so don't get hung up on those specifics.  Just look at the proportions for the bars.)

               

              Also, there are multiple data sources involved here.  But right now I'm trying to play with a hard-coded constant calc field.  Shawn has me pointed in the direction of sizing the sheets uniformly.  Now I just need to propagate bar widths consistently.  Once I get one that appeals to them, I want to find something better than just trying to like them up by eye.

               

              So far, using a calc field just gives me a very skinny bar...

              • 4. Re: Ideas for equal-sized bars from sheet to sheet.
                Joe Oppelt

                Right now the sample workbook is 9.0, but I can just as easily play in 9.2 if you would prefer that.

                • 5. Re: Ideas for equal-sized bars from sheet to sheet.
                  Shawn Wallwork

                  OK, given all that I think you just need to do this:

                  1. Set both Size sliders to the far right
                  2. Create two calculated fields, Top Bar & Bottom Bar, each containing just a 1. (Move to Dimension window.)
                  3. Put them on the Size Shelf on the appropriate Marks Card
                  4. Set the Top Bar Size to Reversed
                  5. Keep the Bottom Bar Size at the default

                   

                  Like this:

                   

                  It seems that in the Default configuration T will use the 'Smallest' size, and the Reversed configuration uses the Largest size. By using these two fields throughout I'm fairly sure you will get uniformity throughout no matter what the data source. Essentially we are playing on Tableau's tendency of using uniform defaults, and working it to our advantage for change .

                   

                  9.2 workbook attached.

                   

                  --Shawn

                  • 6. Re: Ideas for equal-sized bars from sheet to sheet.
                    Joe Oppelt

                    I'm still messing with an uncalibrated slider there.

                    • 7. Re: Ideas for equal-sized bars from sheet to sheet.
                      Shawn Wallwork

                      Well, you're right (sort of). My default theory does seem to work, as it will set the range to a consistent size. Unfortunately this size is too small for your needs. Oh well.

                       

                      --Shawn

                      • 8. Re: Ideas for equal-sized bars from sheet to sheet.
                        Gerardo Varela

                        Joe,

                              I would never due this because it's not supported by Tableau (for those following along make a copy of your workbook I'm not responsible for you breaking it), but you can hack the xml to change the size values.  Once you get use to the xml format it's not hard to do. Caveat:  depending on your pill arrangement and etc etc these values appear in different areas. In your case look for the following in your favorite text editor:

                         

                        <mark class='Bar' />

                         

                        Then underneath that look for.

                         

                        attr='size' value=' 

                         

                        For example:

                         

                         

                        What ever the next values are you can hard code to your hearts content. Same goes for the dashboard placement / size of the sheets.  For that part just look at the end of the xml and look for <zones>. Of course, this might not be a choice for you but it can be done and there is not eyeballing the size mark.

                         

                        Regards,

                        Gerardo

                         

                        P.S  Did I mention this is not supported by Tableau?

                        2 of 2 people found this helpful
                        • 9. Re: Ideas for equal-sized bars from sheet to sheet.
                          Shawn Wallwork

                          Not supported, but the best answer yet!

                           

                          --Shawn

                          • 10. Re: Ideas for equal-sized bars from sheet to sheet.
                            Joe Oppelt

                            Now THAT is what I'm looking for!!!!

                             

                            I've done other hacks like that in the XML (such as inserting itentitical things onto a series of dashboards), but I never considered looking for the size in the XML.  Of course it's in there!!

                             

                            PS:  You should have mentioned that this is unsupported. 

                            • 11. Re: Ideas for equal-sized bars from sheet to sheet.
                              Gerardo Varela

                              Glad I could help!

                               

                              Regards,

                              Gerardo

                              • 12. Re: Ideas for equal-sized bars from sheet to sheet.
                                Joe Oppelt

                                This video says it all for the answer Gerardo suggested:

                                 

                                Charlie Brown "That's it!" - YouTube

                                • 13. Re: Ideas for equal-sized bars from sheet to sheet.
                                  Joe Oppelt

                                  Just to follow up a bit on this, I had to poke around to find the right incidence of 'size' because it's used in different contexts within the XML, as you can imagine.  And in my case I have two different ones per sheet because I have two different bars per sheet.  But it's pretty cool.  Just save successive iterations of the file with different names, open and check your work.

                                   

                                  And I figured it would work this way, but it was nice to confirm ... Tableau has some gangly looking values in there.  Example:

                                   

                                                <style-rule element='mark'>

                                                  <format attr='size' value='1.08546230234'/>

                                   

                                  But I could change that value to '1.1' (or whatever I decided upon) and didn't have to pad out with a pile of zeros.  For the record, to make sure I found the right place, I first changed it to 3.0, which bloated the width and clearly told me I was messing with the right stuff.

                                   

                                  Also (and this was the second part of my question) I can set the height of the overall sheet so that they'll also all be consistent.  For each sheet, near the top of the <style> section is the part that sets the height.  It looks like this.

                                   

                                            <style-rule element='cell'>

                                              <format attr='height' field='[sqlproxy.xxxx.yyyy].[:Measure Names]' value='177' />

                                   

                                   

                                  In my case, for testing purposes, I changed what tableau had there (value='77') to 177, and the sheet grew accordingly after I saved and opened the new one.

                                   

                                  Geraldo -- You shook the right tree for me.  Thanks, man !!

                                  • 14. Re: Ideas for equal-sized bars from sheet to sheet.
                                    Gerardo Varela

                                    Joe,

                                    "Just to follow up a bit on this, I had to poke around to find the right incidence of 'size' because it's used in different contexts within the XML, as you can imagine.  And in my case I have two different ones per sheet because I have two different bars per sheet.  But it's pretty cool."


                                    Hence my caveat! Although, if you scroll up you'll get the worksheet name before the mark element so you can find at least what sheet you're in.  Other useful information to find while playing with the xml: 


                                    <worksheet name='Sheet 2'> 


                                        <dashboard name='Dashboard 1'> 

                                     

                                              <mark class='Bar' />           

                                                       

                                    <color column='[Sample - Superstore - English (Extract)].[:Measure Names]' />


                                    These parent elements will help you find where you're at in the workbook/xml. I found it easier to start with one dimension/measure/worksheet in your data source drag and drop and see what happens.


                                    "Tableau has some gangly looking values in there."


                                    As for all the decimal places, my wild guess is the I EEE floating point standard Tableau uses. (link below) I played around with negative numbers and they didn't take so I knew there was some limitation on those values.

                                     

                                    Just save successive iterations of the file with different names, open and check your work.

                                     

                                    Not fully tested but I’m pretty sure the range for the bar size is 0 – 2.

                                     

                                    http://onlinehelp.tableau.com/current/pro/online/mac/en-us/help.htm#functions_datatypes.html

                                     

                                    Also, you’re very welcome!

                                     

                                    Regards,

                                    Gerardo

                                     

                                    P.S. This is not supported by Tableau

                                    1 2 Previous Next