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
setIntroGapPercent won't compile
Re: setIntroGapPercent won't compile
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.
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.
Re: setIntroGapPercent won't compile
I can't seem to get the set.UpperMargin(0.0) to work...the gap is still there. Any ideas? Thanks Dave.
Kenny
Kenny