Extending Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nitin
Posts: 16
Joined: Wed Dec 03, 2003 10:21 am
Location: Pune

Extending Axis

Post by nitin » Tue Jan 06, 2004 12:28 pm

Hi David,
I am extending NumberAxis to add summary information of chart
I get start point by using dataArea.getX().
After getting this I use RefineryUtilities.drawRotatedString method to write a string .
Now I want the x cordinate of the point where the string ended .I get the width using fontMetrices.stringWidth() but how do I get the x coordinate corresponding to this
Plz help

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 » Tue Jan 06, 2004 10:24 pm

You'd need to apply some trigonometry to the string width to adjust for the angle through which you've rotated the string. There's nothing in JFreeChart / JCommon to calculate it for you.
David Gilbert
JFreeChart Project Leader

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

Locked