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.

here's chart:
enter image description here

use setticklabelfont() change font tick labels. use derivefont() preserve existing font attributes.

domainaxis.setticklabelfont(domainaxis.getticklabelfont().derivefont(16f)); 

image


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -