PDA

View Full Version : Chart x label orientation



mstacey
04-17-2007, 07:38 AM
Hi,

I want to change the orientation of the category labels in a Bar Chart, the text is being truncated.

The <category-label-rotation>45</category-label-rotation> tag seems to be ignored in my .widget.xml file.

I've read that this may not actually be supported, where could I make modifications to allow me to specify this? I'm using Pentaho 1.2 and the ChartHelper API.

thanks!

gmoran
04-17-2007, 10:54 AM
Unfortunately, the code for support for category-label-rotation seems to have gone missing (from my search results). You can add this functionality to the codeline by adding the necessary JFreeChart code to the org.pentaho.plugin.jfreechart.JFreeChartEngine class, and adding support for the XML definition in the org.pentaho.plugin.jfreechart.CategoryChartDefinition class. Follow the "domain-label-rotation" string through the code, that will point you to a similar feature that is implemented much the same way as the category-label-rotation feature.

Should you choose to implement this feature, please send over the code, and we can check it into the main codeline. If not, we should have extensions to chart dunctionality coming up on our roadmap in the near future. this would fall under that umbrella.

Hope this helps,
G

mstacey
04-18-2007, 12:07 PM
Ok, looks like we'll need this functionality along with a couple of other options, I'll have a go at modifying the code and send you the results.

Mark

ingo.klose
05-07-2007, 07:17 AM
Hello Mark,

I ran into the same problem and was just about tho start to implement the same functionality and maybe some others. I was wondering if you have already submitted the changes? If yes, would it be possible to get the source code in advance?

Thank you and all the best,
Ingo

mstacey
05-08-2007, 05:05 AM
Hi Ingo,

work has been mad busy lately so I haven't had a chance to look in to this further, I did discover last week however that the following would achieve some of what I was looking for:

<domain-label-rotation-dir>up</domain-label-rotation-dir>
<domain-label-rotation>45</domain-label-rotation>

That might help you in the mean time.

Mark

ingo.klose
05-08-2007, 06:16 AM
Hi Mark,

thanks for your help. That worked for me.

Just as another hint. From what I could tell the rotation has to be defined in radiant, not degrees. e.g 45° = 0.25 radiant.

Here is a link with a degree/radiant converter: http://wolf.galekus.com/viewpage.php?page_id=10.

All the best,
Ingo