I would like to be able to reduce the font shown in the green box in the image url below. Although this example does not present a problem I will be looking a recording a lot more entries and I would like to be able to display as many points as possible.
https://pasteboard.co/IzOBuKp.jpg
I am using JFreeChart 1.5 files but I've not found an example of how to adjust the font size.
The only text I found online was https://stackoverflow.com/questions/214 ... jfreechart
but I've not had any luck applying it to my code which is based on the demo source DualAxisDemo2.java
Many thanks in advance.
Dave
Help with font size please
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Help with font size please
You can use the setTickLabelFont() method:
Just note in the demo that the line will override any formatting changes you make, so you should either adjust the theme, or make your changes after the theme has been applied.
Code: Select all
plot.getDomainAxis().setTickLabelFont(new Font(Font.DIALOG, Font.BOLD, 6));
Code: Select all
ChartUtils.applyCurrentTheme(chart);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Help with font size please
Thank you for this - I will give it a try,