wrap for XYTextAnnotation - OR textLayout is the answer?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

wrap for XYTextAnnotation - OR textLayout is the answer?

Post by hsp707 » Tue Oct 14, 2008 11:35 pm

Hello People,

Please refer to this image here

http://www.flickr.com/photos/31066816@N05/2943009352/

I need to write some text notes in the left most part and it varies with depth( i.e. domain axis). Right now, I am creating an empty chart and then adding some text annotations (for description that I need to display) at corresponding X,Y. But I know, this solution is not going to work, especially when the 'Description' text is long (sometimes like a small paragraph) and the window size is small. How can get an image like shown in figure above? Is it possible to wrap text annotation added? Should I be using some thing like text layout etc. Or there is some other better way to do it? I was trying to read some articles/javadoc to see if there is a way, RangeMarkers/Domain Markers - will they work? I am really naive for JFreechart and Swings, but if this is the only way to do it, I guess, I will have to dig more into it.

Thank You everyone.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Oct 15, 2008 8:30 am

I would use the addDomainMarker() method to add these lines, but that will only get you single line labels. For the wrapping, you will have to modify the code (you might be able to reuse some of the text classes used for pie section labels to do wrapped labels).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Post by hsp707 » Thu Oct 16, 2008 4:17 pm

Thanks for the reply David. Where can I find those Pie section labels? Are they somewhere in the developer guide? And what would I have to modify in the code - do you mean modifying some API of JFreechart.

Thanks Again.

Locked