An Oracle blog about BI Publisher

  • July 31, 2006

Charts charts charts ...

We had a question come up this week asking effectively why XMLP only supported 3 chart types in our templates. We actually support about 70 distinct types and then variations on top of those; XMLP uses Oracle's BIBeans technology to render the charts. XML Publisher calls the bibeans library using their XML APIs passing an XML chart definition and getting back either an image or an SVG rendition of the chart for inclusion into the final output document. However, the chart wizard in the Word Template Builder only supports 3 of them well 4 if you count Horizontal and Vertical bars as two.

So how do you get to the other 66 chart types?

Right now you need to learn the XML required to manipulate the charts and type it into your template ... a better chart wizard will come in a later version of the template builder but its not here yet. So how can you easily edit the XML?
The BIBeans group have provided the Graph DTD but its not particularly well annotated and in these days of XSD its not of great use. There are some examples posted on metalink (log in first then go here) on how to contruct the XML for specific features but it would be great if you could use an XML editor to create and validate the chart XML as you are building it - JDeveloper comes immediately to mind. but it needs a schema definition to help you. Oracle Reports might be able to help too ...

Let's take a look at the XMLP definition for a simple chart:
<Title text="" visible="true" horizontalAlignment="CENTER"/>
<LocalGridData colCount="{count(xdoxslt:group(.//G_VENDOR_NAME,  'VENDOR_NAME'))}" rowCount="1">
<RowLabels><Label>Invoice Amount Oustanding</Label></RowLabels>
<xsl:for-each-group select=".//G_VENDOR_NAME" group-by="VENDOR_NAME">
<xsl:sort select="VENDOR_NAME"/>
     <Label><xsl:value-of select="current-group()/VENDOR_NAME"/></Label>
<xsl:for-each-group select=".//G_VENDOR_NAME" group-by="VENDOR_NAME">
<xsl:sort select="VENDOR_NAME"/>
       <Cell><xsl:value-of select="sum(current-group()/G_INVOICE_NUM/ENT_AMT)"/></Cell>
</xsl:for-each-group>     </RowData>

Now the part we are we are interested in is the formatting piece of the code, in this chart we have taken the defaults, vertical bar chart with no bells or whistles so the formatting piece is almost empty. From LocalGridData on its really just the data that needs to be charted. So all we need to change is the upper section.

JDeveloper Approach #1 

Step 1: Get that schema ...
After a little heartache I managed to convert the DTD to a schema, you can get it here. Its not been validated by the BIBeans team but it works for me! 

Step 2: Load the schema to JDev ...
Jdeveloper allows you to load a schema and then using their XML editor you can build and validate a graph XML.
Great, you can at least build a valid XML and Jdev can help you with parent/child element relationships and attributes. All you you need do is place the cursor after an element, say Graph and a pop menu will show you the options for that element and tne the values for the attribute ... very cool. 


But is not exactly visual and you still need some knowledge of how the whole thing hangs together i.e I need to know that "graphType" is an attribute of the "Graph" element.

JDeveloper Approach #2

BIBeans can be used in a JDev environment (watch out for the require JDev version), they provide a visual graph builder and thats what we want but it requires you to have an OLAP instance running, etc. After a little 'noodling' (polite term for hacking about) I found out we can fool BIBeans into helping us build the graph using their tools. Please note folks, this is completely unsupported by Oracle so no TARs OK ;o)

After creating a basic XML from the first approach, if we install BIBeans into JDev and then open the XML file for editing we do not see the XML editor but instead we get the BIBeans visual editor. So create a basic XML file using the schema approach above, save it and close it. 


Now, just open the XML file directly and you'll see that we can now use the editor UI to change the look and feel of the chart. I have noticed that the editors do not cover all the minutae of the chart XML but its a lot better than trying to edit the XML directly.
Edit your chart to your heart's content and then save it. Now open up a file explorer window and locate the XML file, open it and you'll notice the required changes have been made to the XML:

<Graph version="" name="Graph" graphType="THREED_AREA_SERIES">
<GraphFont name="Arial" size="8"/>
<Subtitle text="7-31-2006" visible="true"/>
<ThreeDFloor sharePanelProperties="true"/>
<Title text="My Chart" visible="true"/>
<GraphFont name="Serif" size="10" bold="false" italic="false" underline="false"/>

Cool, we can now go back to our RTF template and paste this XML directly into our chart definition. Make suer you omit the final </Graph> tag in your pasting because you already have that in your RTF template definition.

Oracle Reports Approach

Oracle Reports in later versions also supports BIBeans for the chart rendering, check out their documentation. Essentially, they have a chart wizard/editor to allow you to add a chart to your report. Once its built you can get to the generated XML by highlighting the chart object in the layout builder and looking at the 'Graph Settings' property on the property inspector. Its not as friendly as JDeveloper but it works and you can cut and paste into the template.


Hopefully, this article has given you some options to investigate how you can get to all those cool BIBeans charts features in lieu of that XML Publisher chart editor ... its in the works and coming soon.


Join the discussion

Comments ( 3 )
  • Nicolas Boussekeyt Friday, June 19, 2009
    Hi Tim,
    I have try to register Bibean in JDEV but actually i'm not able to create new graphics.
    Can you explain how have 'noodling' olap.
  • Susann Ortwine Monday, August 30, 2010
    What a post!! Very informative also easy to understand. Looking for more such blog posts!! Do you have a facebook?
    I recommended it on stumbleupon. The only thing that it's missing is a bit of color. Nevertheless thank you for this blog.
  • guest Tuesday, May 8, 2012


    I've been looking for any and all information on how to customise BIP graphs in Word/RTF. All I've been able to find seems well out of date, and like your post here, all links to information such as the DTD are dead.

    Would you be able to post up-to-date information on customising BIP graphs in Word?



Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.