no gaps in vertical bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Mohammad

no gaps in vertical bar chart

Post by Mohammad » Fri Jan 31, 2003 9:18 am

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.

Arnaud

Re: no gaps in vertical bar chart

Post by Arnaud » Fri Jan 31, 2003 11:05 am

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);

Mohammad

Re: no gaps in vertical bar chart

Post by Mohammad » Mon Feb 03, 2003 2:57 am

Thanks Arnaud. It worked.

Locked