9 Replies Latest reply on Jan 12, 2016 8:21 AM by Philip Tonge

    Emphasis a single label on an axis

    Philip Tonge

      Hi,

       

      I'm currently putting together a dashboard which will contain a bar chart.  The bar chart will contain PI results for my organisation and other comparable organisations.

       

      I want to format the labels on the vertical axis so that the name of our organisation stands out more than all the others (e.g. bigger font and in bold, for instance).  Is there a way to do this?  I've mocked up in Excel how it might look - with business 7 emphasised.

       

       

      Graph with emphasised label.jpg

       

      I've already got a data label at the right hand side of the bar that shows the value and the bars are coloured to denote quartile groups, so these options are out.  I'm also attaching a filter to let me change the PI being displayed and the organisations will be re-sorted when I do this, so I can't manually add a load of annotations as labels.

       

      Any help would be much appreciated.

        • 1. Re: Emphasis a single label on an axis
          Simon Runc

          hi Philip,

           

          Interesting problem!!

           

          So I've thought of a couple of ways to do this...all pretty 'hacky' as Tableau isn't cell-based (unlike Excel) so hard to isolate a single row and treat it differently.

           

           

          So in order to be able to treat the values differently, we need to have them in the Viz (and not as a header). I've done it 2 ways, one using Size and the other a trick to let us Bold just a single country (in my example)

           

          So the first thing I did was create a parameter of the countries so I can switch the Bold country. I then created the following formula

          [Bold Selected Country]

          IIF([Country] = [Country to Bold],1,0)

           

          which I plan to Size on. Alternatively so we can Bold them, I also created 2 other formulas

          [Bold Selected Country v2 Bold Country]

          IIF([Country] = [Country to Bold],[Country],NULL)

           

          and

           

          [Bold Selected Country v2 Rest]

          IIF([Country] != [Country to Bold],[Country],NULL)

           

          This means that for the 1st formula only the country we want bolded is returned (Else NULL), and vise-versa for the second. As Tableau doesn't (well can't!!) plot NULLs, we can place these side by side (as a Text Mark) and Bold one and not the other....

           

          So to show you the simple version, I've used MIN([Number of Records]) (i.e. 1) as an Axis. I've then brought my 2 formulas onto the text tile, and placed them side-by-side in the text editor, and made the [Bold Selected Country v2 Bold Country] one bold

           

           

          and Voila we get our Bold Country...now this isn't ideal as both Axis (the MIN(1) and the Sales take up the same space, and ideally we want the labels to be narrower.

           

          So in the 'Best Solution - A Bit Tricker' tab, I've created the following formula

          [Sales Fake Axis for Label]

          (WINDOW_MAX(SUM([Sales]))*0.1)*-1

           

          so this, once set up as per the below, takes the Max value it can find and then takes negative 10% of this...sounds odd but bear with me!!!

           

          I then use this, as an Axis, instead of my MIN(1) and then Dual Axis and Sync the Axis...to get the final solution.

           

          Interesting challenge and hope this helps get you what you need, and also makes sense. Please post back if not!...thinking this could make a nice little brain teaser!!!

          2 of 2 people found this helpful
          • 2. Re: Emphasis a single label on an axis
            Adam Crahen

            Hi Philip-

             

            You can do some hackery to make this work.

             

            2016-01-12_10-11-15.png

             

            The trick I used was a Min(-1) and Min(1) dual axis for the first pane.  I put the sub-category and sum of sales as text and used the zero line to draw the border.

             

            The size was done by creating a parameter for sub-category and a calculated field for the size emphasis:

            IF [Sub-Category] = [Emphasize Sub-Category] THEN 2 ELSE 1 END

             

            Put this new field in your view MIN(emphasis) and drop it on size.  You can change the emphasis with the parameter.

             

            9.2 workbook attached.

            1 of 1 people found this helpful
            • 3. Re: Emphasis a single label on an axis
              Mark Fraser

              Hi Philip

               

              I'm replying because I'm interested if/ how anyone tackles this...

               

              I can think of 2 ways, 1 is to create a 2nd field and format that, but its not great

              The other (better?) way is to create a Set, have your company as the only item.

              Put the Set on colour, add Company to the text mark and the column and hide the column header.

              9.2.1 example attached, I used Country in place of Company.

              Its also in number 3 of this blog LODs of Fun with Jedi Filters | Tableau Software

               

              Cheers

              Mark

              • 4. Re: Emphasis a single label on an axis
                Simon Runc

                hi Mark,

                 

                Welcome back to the Northern Hemisphere!!...hope you had a great break?

                 

                So yes this is an interesting problem. On your solution, once you add a measure in (say a Bar chart for sales) the Colouring is now within that Axis...however you can do this by creating 2 sheets, and bolting them together (in a container) on a dashboard.

                 

                The advantage is that it looks much nicer (I don't like the Axis showing negative where my Labels are...on my version, personally I'd be inclined to hide the Axis and show the values against the bars). However if the list of countries was long enough to need scrolling then it wouldn't work.

                 

                If i get sometime today I'll post this one as a Brain Teaser and see what other solutions people come up with!!

                • 5. Re: Emphasis a single label on an axis
                  Philip Tonge

                  Thanks Simon.

                   

                  I'd had a play around with creating some fields and assigning a value based on the business name.  However, I'd only thought to use it to size my bars, rather than create a text  column and size that.

                   

                  I like the last solution best as it means the new labels than take up less space.  I've got a few PIS that have both negative and positive values, taking -10% of the max may not work for them (I.e. it might mean the labels then overlap any negative bars), but I think I could adapt the Window max formula that you suggested.

                   

                  Thanks for your reply.

                  • 8. Re: Emphasis a single label on an axis
                    Simon Runc

                    Coolio! Yes in that case you could use WINDOW_MIN and then minus off, say 100k (in my example) depending on the scale of your values so the Headers appear to the left of any bars.

                     

                    ...I've also created a 'Brain Teaser' for this, as it's an interesting problem and one that gets you to really understand how Tableau thinks!!

                    Educational Brain Teaser: Bold Single Label on a Header

                    • 9. Re: Emphasis a single label on an axis
                      Philip Tonge

                      Great.  I'll keep my eye on that thread to.  Thanks.