Just as the title says, if I have a JFreeChart
(or want to create one) how do I specify the font that is used for the values on the axis? Not the axis label, but the actual values. Specifically I just want to make the font a little bigger.
For Range Axis
CategoryPlot p = chart.getCategoryPlot();
ValueAxis axis = p.getRangeAxis();
For Domian Axis
CategoryPlot p = chart.getCategoryPlot();
CategoryAxis axis = p.getDomainAxis();
then set the font like
Font font = new Font("Dialog", Font.PLAIN, 30);
axis.setTickLabelFont(font)
Try setTickLabelFont(java.awt.Font font)
on the relevant 'Axis'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With