Code: Select all
public class CustomFontCategoryChartCustomizer implements JRChartCustomizer {
@Override
public void customize(JFreeChart chart, JRChart jasperChart) {
Font customFont = new Font("DejaVu Serif", Font.PLAIN, 9);
CategoryPlot plot = chart.getCategoryPlot();
// Set legend's font
chart.getLegend().setItemFont(customFont);
// Set categories label's font
plot.getDomainAxis().setTickLabelFont(customFont);
// Set amounts label's font
plot.getRangeAxis().setTickLabelFont(customFont);
}
}
Any help? Thank you in advance
P.S.