0

I'm using JFreeChart and trying to move the bars little closer to other bars in BarChart.

I have gone through other question and answers in Stack Overflow and it is a duplicate question, but it's not successful here.

    JFreeChart chart = ChartFactory.createBarChart("Fund Transfer", "Transaction Results", "Summary Of Transaction", bardataset, PlotOrientation.VERTICAL, false, true, false);
    if(chart != null)
    {
        int width = 760;
        int height = 470;
        BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
        renderer.setMaximumBarWidth(0.03);
        final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
        response.setContentType("image/png");
        OutputStream out = response.getOutputStream();
        ChartUtilities.writeChartAsPNG(out, chart, width, height, info);
    }

Currently I getting BarChart output as below. enter image description here

So as per my above code what change I need to do for decreasing space b/w bars?? AnyOne suggest me.

Kamal
  • 155
  • 2
  • 2
  • 11

0 Answers0