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.
How to change the axis value font on a JFreeChart
Asked Answered
Try setTickLabelFont(java.awt.Font font)
on the relevant 'Axis'.
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'.
© 2022 - 2024 — McMap. All rights reserved.
setTicklabelFont
->setTickLabelFont
– Temperamental