The setXXXMargin() methods (according to the api) receive parameters of type double that signify a percent of the DomainAxis length.
So here's what I tried to do:
Code: Select all
categoryPlot.getDomainAxis().setLowerMargin(0.05);
categoryPlot.getDomainAxis().setCategoryMargin(0.05 * (numberOfCategories - 1));
barRenderer.setItemMargin(0.02 * numberOfCategories * (barsPerCategory - 1));
categoryPlot.getDomainAxis().setUpperMargin(1 - (categoryPlot.getDomainAxis().getLowerMargin() + categoryPlot.getDomainAxis().getCategoryMargin() + barRenderer.getItemMargin()));
Thanks in advance.