Wednesday, 24 July 2013

BI Publisher Graph Formatting Part 2

In BI Publisher Graph Formatting Part 1 We made some changes to line graph now to moving ahead.

Now as you can see the below mentioned graph in which the x-axis label are horizontal and are overlapping each other. 
 
In rtf template while creating BI Publisher report it is working dynamically but if we want to show the x-axis label vertically we can do so for the same we will make some changes in the Advanced tab of charts.Please enter the below code after the tag <LegendArea visible="true" />. 

<O1TickLabel textRotation="TR_HORIZ_ROTATE_90" automaticRotation="AR_NO_ROTATE"></O1TickLabel> 

After making the changes mentioned above you will find that the x-axis label are now vertically displayed.
   


Now much of the formatting is done but now if we want to see the y-axis label without the scale factor the need to make some changes with respect to the scale we can do that too. 
For making the changes with respect to the scale of y-axis please use the following code in the advance tab and place it before the <LocalGridData> 
<Y1Axis><ViewFormat numberType="NUMTYPE_GENERAL" numberTypeUsed="true" decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true" scaleFactor="SCALEFACTOR_NONE" scaleFactorUsed="true" /></Y1Axis> 

So after placing the above code please see below the graph changed as shown below:
 

Now similarly if you want to make the changes with respect to the values on the line graph you can make that change too. 
For the same please use the below mention code in the advance tab. And place it after the <MarkerText visible="true" markerTextPlace="MTP_OUTSIDE"> tag. 
<Y1ViewFormat><ViewFormat numberType="NUMTYPE_GENERAL" numberTypeUsed="true" decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true" scaleFactor="SCALEFACTOR_NONE" scaleFactorUsed="true" /></Y1ViewFormat> 

After making the above changes the graph will reflect as shown below.
 

For doing the same please use the below mention code in the advance tab and place it before the <LocalGridData>    
Now we will move towards the next step i.e if we want to show the values on the y-axis i.e Revenue using Currency symbol we can do that too also. 

<Y1Axis><ViewFormat numberType="NUMTYPE_CURRENCY" currencySymbol="$"  numberTypeUsed="true" decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true" scaleFactor="SCALEFACTOR_NONE" scaleFactorUsed="true" /></Y1Axis> 

So after making the changes mentioned above you will find that the currency symbol has been seen in the graph.
   

As you can see we have made some many changes in the graph and this same logic can be used in other graphs also. 
So now in my next blog will be coming up with something more on graphs and at the same walking you through the steps of implementing the bursting in BI Publisher.  
So please wait for the same…………….


17 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Superb Alok its really very Helpful, Keep Posting Cheers !!!!!

    ReplyDelete
  3. Hallo Alok,

    thank you for this insight. Did you ever format date values on the Y-axis? I can't find anything to solve this topic in the net. My intent is to have date values formatted on both axes.

    Do you have any idea?
    Thank you
    -t

    ReplyDelete
    Replies
    1. Hi Tom,

      Have never tried but could you pass the template and data sample i would try and update you.
      Can give a try on it as of now it never came as a requirement to me so didn't tried.

      Thanks,
      Alok

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hi Alok,

    have you ever tried showing currency symbol($) in graph(over y-axis for amount field).
    i really need help on this.

    Best Regards,
    Shaikh

    ReplyDelete
    Replies
    1. Hi Zeenat,

      We can do that use the below changes and try.

      After this if you are still facing issue then let me know.

      Thanks,
      Alok

      Delete
    2. Hi Alok,

      Thank you sooooo much. i was hunting for this solution since a long time.

      one more help, after adding tag for '$', negative values are displaying in parenthesis i.e -10000 as ($10000).

      can we remove parenthesis and bring back negative sign???

      Delete
    3. Hi Zeenat,

      Please try add the below mentioned tag in the that which specifies the number format setting.
      negNumFmt="NEG_NUMFMT_NUM_NEG"
      And update me if you are still facing issue.

      Thanks,
      Alok

      Delete
    4. Hi Alok,

      thanks for instant response.
      it worked :D

      would you please give me one more favor, my y axis display amount which is in million. i need to display 'M' along with amount. i.e $12000M, $13000M.

      i tried using scaleDownMillions="M" but did not work.

      any suggestion please......

      Best Regards,
      Shaikh

      Delete
    5. Hi Zeenat,

      Use the below format scaleFactor="SCALEFACTOR_MILLIONS" and check if it works or not.

      Thanks,
      Alok

      Delete
    6. This comment has been removed by the author.

      Delete
    7. Hi Alok,

      actually amounts are already in millions (i.e amount/1000000), when i use scaleFactor="SCALEFACTOR_MILLIONS" its displaying all values as $0M along y-axis.
      i just need to append 'M' in values.

      if you could share your mail id, will send my sample template.

      Best Regards,

      Delete
    8. My Email Id is liveonown@gmail.com

      Delete
    9. Thank you so much alok.

      have mailed you some queries, any help would be really appreciated.

      Best Regards,

      Delete
  6. Hi Alok,

    is there any way to display -ve scale values in red color along the y-axis.


    Regards,
    Zeenat

    ReplyDelete
  7. Thank you so much for these amazing articles,
    pls is there any one play with pareto & combination chart ?

    ReplyDelete