JFreeChart - Axis label positioning

北慕城南 提交于 2019-12-24 08:27:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!