想修改下bar3d x轴上的字体代码如下
[code="java"]
CategoryPlot categoryplot = jfreechart.getCategoryPlot();
//Customisation the chart
//set background white
jfreechart.setBackgroundPaint(Color.WHITE);
categoryplot.setForegroundAlpha(1.0F);
CategoryAxis categoryaxis = categoryplot.getDomainAxis();
categoryaxis.setTickLabelFont(category, new Font("隶书",Font.PLAIN,10));
[/code]
但是最后一行的category应该传什么参数进入,setTickLabelFont有个单参数的方法,但是用在
categoryaxis上好像不行。
[b]问题补充:[/b]
用过了,提示没有这个方法,在其他的图表里是可以用的,所以感到很奇怪
[quote]用过了,提示没有这个方法,在其他的图表里是可以用的,所以感到很奇怪[/quote]
:o .
你去网上下些示例,看看会不会一样的效果
[url]http://www.iteye.com/topic/466387[/url]
API:
[quote]void setTickLabelFont([color=blue]java.lang.Comparable category[/color], java.awt.Font font)
Sets the font for the tick label for the specified category and sends an AxisChangeEvent to all registered listeners.[/quote]
不过一般这个参数都省略了。。
直接[code="java"]categoryaxis.setTickLabelFont(new Font("隶书",Font.PLAIN,10)); [/code]