Tuesday, 23 July 2013

BI Publisher Graph Formatting Part 1



Hello Everyone,

                Just want to share with you regarding the BI Publisher tips and tricks or issues that I faced while working on the tool. You may have seen or read this issue at some other blogs or using some other ways you may have figure out.Just started my blog to explore more on BI Publisher issues and tried to consolidate all at one place.

BI Publisher Working with Graphs:
Line Graph:
Default Line chart in rtf template looks like one shown in the figure below.
As you can see in the default graph above prepared in rich text format does not provide us much flexibility.
So as per my requirement, need the below mention points to be solved in my graph:
a)     Thickness of the line graph should be less.
b)     Data labels should not contains any decimal place
c)     Data labels should not overlap with the Y-Axis
d)     Data labels should be displayed by a Marker on the line graph.

So for doing the same we will solve the issue one by one by using the Advanced tab in the charts.

Thickness of the line graph should be less :-
For doing so we just need to add a lineWidth="2" in the seriesitem tag in the advanced option of the charts.
<SeriesItems><Series id="0" color="#C0C0C0" lineWidth="2" /></SeriesItems>
After making the changes please find the reduction in the thickness in line graph as shown below.
 

Data labels should not contains any decimal place:-
As by selecting the decimal place value as zero then also it always shows with one decimal points.
So for achieving the same please find the changes that needs to be done in the advance chart option.
<Y1ViewFormat><ViewFormat decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true" /></Y1ViewFormat>

Add this in tags after the <MarkerText visible="true" markerTextPlace="MTP_OUTSIDE_MAX"> tags as we are using the measure in our Y-Axis so formatting tag contains Y1ViewFormat.
So by doing so we will be able to remove the decimal from the data label please see the figure below:
Data labels should not overlap with the Y-Axis:
As you can see the data label for the Quarter 2008Q1 is overlapping the Y-Axis and it little difficult to see as well. So for the same we will use some tags or parameter to re arrange the datalabel i.e marker text on the graph.
<MarkerText visible="true" markerTextPlace="MTP_CUSTOM" markerTextAngleDefault="45" markerTextRadiusDefault="25">
Where markerTextAngleDefault specifies at which angle the data marker should be present.
markerTextRadiusDefault specifies from how much distance from the center of the marker should value be displayed.
markerTextPlace: for using the adove parameter or tags we need to use MTP_CUSTOM as the value by default there are other values like “MTP_OUTSIDE_MAX,MTP_ON_MAXEDGE,MTP_INSIDE_MAX,MTP_INSIDE_MIN”
But for using the above parameter or tags we need to use markerTextPlace as “MTP_CUSTOM”
So by making the changes as discussed above you can see there is a difference in the data label value displayed and it is shown below.
Data labels should be displayed by a Marker on the line graph:-

Ad you can see the data label displayed on the line graph does not have any marker or symbol on the line to represent it.
So to achieve the same we will be adding some custom code to do the same.
Please add the mention stuff in the advance chart option to achieve it markerDisplayed="true" markerShape="MS_DIAMOND"

<Graph seriesEffect="SE_AUTO_GRADIENT" graphType="LINE_VERT_ABS" markerDisplayed="true"><SeriesItems><Series id="0" color="#C0C0C0" lineWidth="2" markerShape="MS_DIAMOND" />
After making this changes it will be displayed on graph as shown below.
So by using the above options was able to achieve some of the formatting as required.
Will be coming up with Part 2 for BI Publisher Graph Formatting soon.

11 comments:

  1. How do you access the Advanced tab in Page Layout? I'm running OBIEE 11.7, but there does not appear to be any tab to access the XML.

    ReplyDelete
  2. Is there a tag that can be used to ensure a min distance between tick labels for a stacked bar-chart to ensure tick lables are not printed on top of each other?

    ReplyDelete
    Replies
    1. Hi John,

      You can use the angle to display the labels and on that basis you can do it as far as i know.

      Thanks.

      Delete
  3. Hi Alok,
    I've a query with respect to your article' BI Publisher Graph Formatting Part 1
    '
    in the formatting, where you've given that to control the width of the graph, add lineWidth="x".

    I want to show only markers, with no lines connecting them.Hence, I've given lineWidth="0". But, it seems the graph is taking "1" value again and showing the same graph.

    It would of great help, if you could resolve my query

    Thanking You,
    Chaitanya K

    ReplyDelete
    Replies
    1. Hi Chaitanya,

      Yes by default it takes the value as 1.
      But if you only want to show marker and not the line then please use the line colour as white as a work around and if i get anything i will update the same to you.

      Thanks,
      Alok

      Delete
  4. Hi Alok,

    I am looking for a way to only show the last quarters value. Hence in your example only show the value for 2010Q4 on the line. The graph has to be plotted but only show the last value.

    Thanks.
    Jeby

    ReplyDelete
    Replies
    1. You can use Group by clause outside the graph to make sure that you only show the data that you need to show in graph.
      If you want can send me sample xml and result example so that i can prepare a sample template for you to make to understand.

      Thanks,
      Alok

      Delete
  5. Hi Alok,

    is there any way to display marker value inside maker shape we use????

    actually i am using markerShape="MS_CIRCLE" and need to show marker values inside the circle.



    Best Regards,
    Zeenat

    ReplyDelete
  6. Hi Alok,

    Is there any way to display the whole value in the data label instead of using K. i.e. 686K to 686000.

    Best Regards,
    Sid

    ReplyDelete
  7. Hi Alok,

    Found your article much helpful. Am using Bar Graph - Vertical chart type. How do I place the bar values in the 90 degree position on top of the bar.

    Regards,
    Abdul Muheeth

    ReplyDelete
  8. Hi
    Just like in excel we have no line option and only marker can be shown . Is theere any way in bipub we can hide the line and only market is viisble.
    thanks

    ReplyDelete