setIntroGapPercent won't compile

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

setIntroGapPercent won't compile

Post by Kenny Dubuisson » Fri Oct 25, 2002 5:22 pm

When I add the following line to my servlet:

plot.setIntroGapPercent(0.0);

my servlet will not compile. I get an unresolved symbol error on it. I want to set my plot to print the first value starting right against the y-axis so I thought this was the line to add. Any ideas?

Thanks,
Kenny

Dave Gilbert

Re: setIntroGapPercent won't compile

Post by Dave Gilbert » Mon Oct 28, 2002 9:40 am

Hi Kenny,

That is a method in the CategoryPlot class, so it will work for most of the bar charts, and a few other chart types as well.

But if your chart is based on XYPlot (which is my guess), then you have to use a different approach. Here the auto-range calculation on the axis is adding a small margin (5% by default) to each end of the axis. You can change it like this:

XYPlot plot = myChart.getXYPlot();
ValueAxis axis = plot.getDomainAxis();
axis.setLowerMargin(0.0);

There is a setUpperMargin(...) method also, to control the other end of the axis.

Regards,

DG.

Kenny Dubuisson

Re: setIntroGapPercent won't compile

Post by Kenny Dubuisson » Tue Oct 29, 2002 6:26 pm

I can't seem to get the set.UpperMargin(0.0) to work...the gap is still there. Any ideas? Thanks Dave.
Kenny

Locked