问题
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:
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.
来源:https://stackoverflow.com/questions/2493983/jfreechart-axis-label-positioning