Hi,
I have to suppress the gaps between the bars of a vertical bar chart. I tried modifying the file CategoryPlotConstants.java to make all default values to 0, and replaced the class file in the jar with the compiled CategoryPlotConstants.class. but that doesn't seem to work.
Can you tell me how I can make the bars in the bar chart appear together.
Thanks.
no gaps in vertical bar chart
Re: no gaps in vertical bar chart
Hello Mohammad,
You should look the methods within the CategoryPlot (com.jrefinery.chart.CategoryPlot) class. The package as been well written (thanks David and other contributors), and You don't need to change the contstants, but use the dedicated methods :
- setIntroGapPercent(double)
- setTrailGapPercent(double)
- setCategoryGapsPercent(double)
- setItemGapsPercent(double)
As You can guess, the double parameter is the GapPercent You want to set.
I didn't try, but something like this should work :
((CategoryPlot) myChart.getPlot()).setCategoryGapsPercent(0.0);
You should look the methods within the CategoryPlot (com.jrefinery.chart.CategoryPlot) class. The package as been well written (thanks David and other contributors), and You don't need to change the contstants, but use the dedicated methods :
- setIntroGapPercent(double)
- setTrailGapPercent(double)
- setCategoryGapsPercent(double)
- setItemGapsPercent(double)
As You can guess, the double parameter is the GapPercent You want to set.
I didn't try, but something like this should work :
((CategoryPlot) myChart.getPlot()).setCategoryGapsPercent(0.0);