X

An Oracle blog about BI Publisher

  • RTF
    January 30, 2008

Misbehavin' Baa Chart Labels

Another charting 'tidbit' today  - for those of you in the UK substitute the 't' - its too rude for American ears/eyes so we use a 'd' here ... 'phnarr, phnarr' - sorry America another UK joke, that is, unless you read one of the more boorish comics from the UK in which case, Go Finbarr!
 
I wish I could find a way to help you more to relieve the pain and misery that is the fine tuning of charts in BIP. There is a new chart dialog coming with a property palette for all the finite control you might need but thats a little ways out.
When I get questions, I resort to trawling throu the graph DTD to try and find what I need to get some niggly piece of text to behave as I need - its a slow and laborious process. 
I received a mail from Mayur from Keste, an Oracle partner yesterday asking:



I want a simple Bar chart (Single Bar) with numbers on top. See below image.


I have following code for the image on the template.



ChartLabel1:

chart:



<Graph depthAngle="50" depthRadius="8" pieDepth="30" pieTilt="20" seriesEffect="SE_AUTO_GRADIENT">
<Title text="MBS Past 24hrs Dispatches" visible="true" horizontalAlignment="CENTER"/>
<MarkerText visible="true" markerTextPlace="MTP_TOP"/>
chart data definition ...
</Graph>




I am able to see the chart, with numbers. But numbers are with decimal points. Like 31.00, 20.00, 2.000 etc. I want to see number like 31, 20, 2, 13, 16 etc. I have tried to format using ViewFormat, but it痴 not working.



I have been playing with it on and off and getting annoyed, you may remember I documented the same thing for Pie charts a while back. Applying the same principles I started looking for the right elements to use in place of PieLabel - how about 'ColLabel' ... nope, not there, there is a ColLabels but thats no use. After a lot of frustration I came up with an idea this morning to load the DTD into XMLSpy and then convert it to a schema. XMLSpy has a nice expand and collapse feature for schemas that lets you see dependencies, etc. Within 2 mins I had the code I needed! 

So if you need to control the number format of your bar values then just add:



<MarkerText visible="true">
<Y1ViewFormat>
<ViewFormat decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true"/>
</Y1ViewFormat>
</MarkerText>



under the <Graph> tag ... boo ya!

Join the discussion

Comments ( 7 )
  • Dhaya Monday, May 11, 2009
    Hi Tim,
    I have an issue. I have created a template which has a Chart.
    When i preview the report through Word in desktop, chart is coming .
    but when i run through the peoplesoft PIA chart is not coming.
    Kindly please suggest me how can i see the chart.
    Many thanks in advance.
    Regards,
    Dhaya.
  • Amar Mistry Thursday, September 3, 2009
    Awesome... this worked for me...
    This is exactly what I was looking for - controlling decimal points over the pillars in bar chart...
    Now, one more question .. can I display % sign next to the marker text? If so, how?
    Thanks for posting that Marker Text soultion...
  • Tim Thursday, September 3, 2009
    Hi Amar
    Yes you can display the % sign. You need two more attributes in the ViewFormat element
    numberTypeUsed="true" numberType="NUMTYPE_PERCENT"
    These will format the numbers to percentages
    Tim
  • Amar Friday, September 4, 2009
    Tim
    That worked fine.
    Thanks again for your help. I really appreciated it.
    Amar
  • Nam Nguyen Wednesday, September 30, 2009
    Hi Man,
    It's not working with line chart. I get angry of always showing 100K instead of 100000. How to fix it friend? Please help me asap.
    Thank you in advance.
    Nam Nguyen
  • Mohit Sunday, April 25, 2010
    Dear Tim,
    I have an issue. I need to decrese the font size of the Bar Values in chart. Also i need to change the format of numbers displayed. They are getting displayed in #### form and i need in ## form only.
    How to achieve this.
    Mohit
  • Mohit Sunday, April 25, 2010
    Dear Tim,
    I have an issue. I need to decrese the font size of the Bar Values in chart. Also i need to change the format of numbers displayed. They are getting displayed in #### form and i need in ## form only.
    How to achieve this.
    regards,
    Mohit
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.