Shape Up!

Some of you may have seen the 'shape' support we have with our RTF templates in the documentation, some of you may have played about a bit with it and thought, 'OK, so what can I do with them from a business perspective?' Some of you may have found uses for them, if you have, please share with it the class!
Since they were introduced as a bit of a side project from Edward (back then 'Mr RTF Template') I have always struggled a little when talking about the shape support, yeah, its cool but what can I use it for. I have written about using them to build a gantt chart and we have seen a few other applications for them - overall they fall into the 'well I cant build what I want in your charting engine so I'll have a stab at shapes!'

This past week Mike, our Product Manager dropped a good one into our respective laps. Do we have the ability to generate this:


I took out the performance measure titles but you get the idea.

There is quite a lot going on here, it was funny to see it, I had just seen something very similar as a requirement from another customer. They had actually abandoned they're visualization because it was too confusing. This one seemed much easier to read although technically a little more complex.

I did not think our current charting engine was up to it, maybe some combination of a couple of charts overlaying each other would get it done but it gets messy very quickly doing that. Shapes was an alternative that might just work, all I would need would be some background table, then a couple of yellow triangles, a black one, a circle and a horizontal line - easy!

Did not have any data to work with so came up with some and made some assumptions:

<NAME>c.Makes the coffee really well</NAME>

Looking at the graphic you can hopfully work out how the data maps to an 'icon'. 'COG' is the 'Center of Gravity', an average of the evaluators scores for a given metric. The horizontal line joins the start and end of the evaluators range.

The RTF template for the chart is pretty simple really.


The for-each field is looping over the PERFORMANCE loop, the shapes are sitting atop each other with the following code:

Yellow Triangle1 <?shape-offset-x:EVAL_START * 104.7?>
Yellow Triangle2 <?shape-offset-x:EVAL_END * 104.7?>
Black Triangle <?shape-offset-x:COG * 104.7?>
Circle <?shape-offset-x:VALUE_SELF * 104.7?>
Line <?shape-offset-x:EVAL_START * 104.7?>
<?shape-size-x:number(EVAL_END) - number(EVAL_START)?>

Straightforward shape stuff, the shape-offset-x moves the shape along the x (horizontal) axis and the shape-size-x (for the line) extends it. Whats the 104.7 for then? Thats the fun part of shapes, in this case its the multiplier to move the object 'x' pixels - I needed to get the shape to sit on the appropriate vertical line and after a litte trial and error I got to 104.7 pts - its not quite there but a little more tweaking will get it spot on.

Shapes are a little funky, they float around on top of the rest of the layout, so our RTF engine has to find them and pin point their position - its not always spot on so you need to do a little 'noodling', a technical term, to get them to the right position. Thank heavens for the template builder to let me 'noodle - test', 'noodle-test', etc.

Here's the final output in PDF


Its close, I missed the last two columns out, thats just simple conditional formatting - I wanted to concentrate on the shape manipulation functionality.
If you get a tough visualization from your users and think how the heck can I do that? Get on and shape up!


Hi Tim, I would like to shape up :-) I find it difficult to get started with charts. It is easy to create a simple chart with the Word Plug-in but it is never exactly what you want. Then you have to look at the the BI Beans graph DTD. I can't find any documentation except the DTD it self and I find the DTD a bit difficult place to start. Can you point me to any other documentation? Would it help me to download Oracle Reports that also uses the DTD and use the GUI as a starting point? Regards Pete

Posted by Peter Lorenzen on June 17, 2008 at 07:53 AM MDT #

Hi Pete Its tough, the BIBeans team do not document their XML interface. And sadly have no plans to either. I have written a few articles about chart building. Tim

Posted by Tim Dexter on June 17, 2008 at 09:50 AM MDT #

I am trying to build a Org chart and would like to if it possible to change the color of the autoshape using any commands.

Posted by Nandini on November 25, 2009 at 07:00 PM MST #

nice story dude thank you

Posted by hack rs on December 06, 2009 at 02:15 AM MST #

Great information here, i'll tell my friends about this blog so they can benefit from all the information stated here, keep up making good posts like this, thank you very much sir.

Posted by patent an idea on February 02, 2010 at 10:25 PM MST #

I found a similar post on a different site and didn't really understand it, but your post makes it clearer to me now. Thanks!

Posted by Ming Mackstutis on July 26, 2010 at 12:35 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!


« April 2014