2 Replies Latest reply on Sep 4, 2012 9:10 AM by Andy Piper

    Constant number for reference line

    Ajit Kumar

      Scenario – I have created a bar graph. I have to give constant number for reference line. I understand that it is possible to apply for whole graph but I am not able to give constant number for per Pane and Per cell.

       

      In below chart for whole graph I can give the reference line for constant number but for 1,2 and 3 as well as per cell I am not able to give the constant number reference line

       

      Picture1.png

       

      Please suggest me way around

       

      Ajit

        • 1. Re: Constant number for reference line
          Tom Brant

          Ajit,

           

          I think what you could do is create a Calculated field based off of your field at the top of the chart. Would look something like this: "Case field1 when "1" then value1 when "2" then value2 when "3" then value3 end"

           

          Add this field to your Rows section and make this a dual axis chart. Then change the aggregation from Sum to Avg for your new calculated field. You can use multiple mark types, bars for your Profit and a Line for your calculated field. Synchronize your axis as well so the line shows where you want it to. The line won't go across the whole section but its a start.

           

          Hopefully this helps.

           

          Thanks,

          Tom

          1 of 1 people found this helpful
          • 2. Re: Constant number for reference line
            Andy Piper

            Ajit,

             

            Piggy-backing a bit off what Tom has mentioned, you can add lines to the bar chart by adding another measure to your Rows shelf, using multiple marks, and a dual axis. If you want to have a constant line, I would use a Gantt bar as the second measure type for this type produces a straight line across that can represent your constant.

             

            Here are some steps to use:

            1. Add your constant measure value to the rows shelf (second pill).
              This creates two bar charts on top of each other.
            2. Click on the drop down at the top of the Marks object and select Multiple Mark Types
            3. Click the right arrow next to All within the Marks object until the second measure field on the rows shelf is displayed.
            4. Change the second mark from "Bar" to "Gantt Bar"
            5. Click the drop down arrow on your second measure field on the rows shelf and select Dual Axis.

             

            Your bar chart worksheet would go from

            to this

             

            You may wish to consider setting the color of the second mark based on the same field as the second measure being used or a different field (up to you). See the attached SuperStores Sales based workbook as an example of what I'm suggesting and how I set it up.

             

            Hope this helps.

             

            Andy Piper