Font Size and type of the Y axis Tick

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Sumit

Font Size and type of the Y axis Tick

Post by Sumit » Thu Aug 15, 2002 10:55 pm

Hi,
Please could you let me know as to how I can change the font size and type of the Y axis tick. I am new to using the JFreeCharts so may be there is something Im missing on here.
Thanks,
Sumit

David Gilbert

Re: Font Size and type of the Y axis Tick

Post by David Gilbert » Fri Aug 16, 2002 6:19 am

You can change the font size and the tick size like this:

CategoryPlot plot = myChart.getCategoryPlot();
NumberAxis axis = (NumberAxis)plot.getRangeAxis();
Font font = new Font("SansSerif", Font.PLAIN, 10); // change to whatever you want
axis.setTickLabelFont(font);
axis.setTickUnit(new NumberTickUnit(5.0, new DecimalFormat("0.00")));

Regards,

DG

Jakob Vad Nielsen

Re: Font Size and type of the Y axis Tick

Post by Jakob Vad Nielsen » Fri Aug 23, 2002 7:26 am

In what package can I find the DecimalFormat class?

David Gilbert

Re: Font Size and type of the Y axis Tick

Post by David Gilbert » Fri Aug 23, 2002 7:29 am

java.text I think.

Regards,

DG.

Locked