views:

275

answers:

1

I want the label of one of my axis to be two words, each aligned to the beginning and end of said axis - I've been doing this by inserting spaces in the Axis label, but it's a crappy solution.

Is there a way to align label text for a JFreeChart chart?

Thanks for any replies!

+1  A: 

You can override drawLabel to achieve any desired effect. Invoke getFontMetrics() on the parameter g2 to position the text precisely. The JCommon class TextUtilities, used extensively in JFreeChart, may offer more convenience.

trashgod