jFreeChart setLabelFont size not working in GroupedStackedBarRenderer -
i'm using groupedstackedbarrenderer allow subcategory in chart. add subcategories , control font size of subcategory with:
subcategoryaxis domainaxis = new subcategoryaxis(""); domainaxis.addsubcategory("skill 1"); domainaxis.addsubcategory(...) domainaxis.setsublabelfont(new font("tahoma", font.plain, 12));
but following line has no effect on major category itself, date labels:
plot.setdomainaxis(domainaxis); font font3 = new font("dialog", font.plain, 16); domainaxis.setlabelfont(font3);
on reflection realize need reference category domain axis rather subcategory. tried following:
categoryplot catplot = (categoryplot) chart.getplot(); catplot.getdomainaxis().setlabelfont(new font("tahoma", font.plain, 20));
but still didn't work.
use setticklabelfont()
change font tick labels. use derivefont()
preserve existing font attributes.
domainaxis.setticklabelfont(domainaxis.getticklabelfont().derivefont(16f));
Comments
Post a Comment