4 Replies Latest reply on Feb 27, 2016 7:43 AM by Tharashasank Davuluru

    Background color an entire column in a bar graph

    Jay Sridharan

      Hey Guys,

       

      I've got a graph that looks like this:

       

      origBreachDistributions.JPG

       

      But it's a little difficult to distinguish between the different groups. Is it possible to give a background color to the entire group of columns?

       

      Like this:

      coloredBreachDistribution.JPG

       

      The workbook is attached. Thank you!

       

      --Jay

        • 1. Re: Background color an entire column in a bar graph
          Adam Crahen

          Hi Jay-

           

          I cannot open your workbook.  Export -> Packaged Workbook will create a twbx we can open next time.

           

          Here is a quick sample showing it is possible.  There are other ways if you want to share your workbook, I'll take a look.

           

          9.2 workbook attached.

          1 of 1 people found this helpful
          • 2. Re: Background color an entire column in a bar graph
            Jay Sridharan

            Hey Adam,

            Sorry about that.. I have attached a .twbx now.

             

            What you have sent looks great, but I'm not sure how you got there.. Please guide me in doing so.

             

            Thanks,

            Jay

            • 3. Re: Background color an entire column in a bar graph
              Adam Crahen

              Hi Jay-

               

              Here is the trick, you have to use a dual axis and make one of the axes (preferably the first) all the same size.  The first is better because the marks from the 2nd pill will be drawn on top of the first.

               

              In the example I sent you, I used MIN(number of records) which is always 1 so the background could be drawn the same size, but I don't love that because the first axis will just say 1 and it isn't clean looking.

               

              Size

              WINDOW_MAX(max([breachDefenseCount])) +.9

               

              This will calculate the max(breachDefenseCount) in the view and add a little padding (.9) to the top so the background will always be higher than the bar.  Also, this field can now be placed first on the row shelf.

               

              2016-02-27_00-29-27.png

              I changed your 2nd pill to be max rather than attr - returns the same result.  Right click on the maxBreach pill and select dual axis.  Then right click on the right axis and check synchronize axis.  One more right click on the axis and uncheck show header.  Right click the left axis, then edit axis and rename the from Size to whatever you want.

               

              Notice when you have the dual axis turned on you have multiple marks cards.  Look at each to see how they are setup.  They originally turn to circles by default.  Turn them both back to bar.  On the Size marks card, use size as size and then dial the size all the way up.  Team number on color (turn the filter to all when you are setting the color).  Dial the transparency down to mute the background colors.  I think this is at 45%.

               

              I also turned off your column borders and added some shading to the workbook so you didn't have a white space at the top.  I turned a black border on the real bars to make them pop.

               

              Let me know if you have any questions.  Lots of small little formatting changes to make it look better because I am particular about that left axis looking good!

               

              9.2 workbook attached.

              2 of 2 people found this helpful
              • 4. Re: Background color an entire column in a bar graph
                Tharashasank Davuluru

                Jay Sridharan

                 

                I think you have the got the correct answer. please mark it as correct answer. so that other can find it very easily.

                 

                Thank you

                 

                Shasank