Search code examples
javajfreechart

JFreeChart 3D bar chart— can't increase Z axis depth


I try to increase Z axis size at my 3d bar chart. I use at version 1.0.19, and can't find proper method to do this. Any ideas?

enter image description here


Solution

  • To alter the faux depth, you can adjust the offset parameters in your BarRenderer3D constructor, for example:

    BarRenderer3D r = new BarRenderer3D(
        3 * BarRenderer3D.DEFAULT_X_OFFSET / 2,
        3 * BarRenderer3D.DEFAULT_Y_OFFSET / 2);
    categoryPlot.setRenderer(r);
    

    image

    To adjust the category label position and font size, use the approaches shown in JFreeChart Bar Graph Labels. See also Migration from JFreeChart 1.0.x regarding 3D charts.