single data point - bar width

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

single data point - bar width

Post by Todd » Sun May 19, 2002 5:37 am

I'm dynamically generating bar charts using ChartFactory.createVerticalBarChart and some of the queries return a single data point. This renders a single honking wide bar. I've tried using .setIntroGapPercent and .setTrailGapPercent whenever there's only one in an attempt to slim this bar down but it looks like it maxes out at 20% anything higher gets me

java.lang.IllegalArgumentException: BarPlot.setIntroGapPercent(double): argument outside valid range.

Has anyone come up with a work around for this?

Thanks

Todd

David Gilbert

Re: single data point - bar width

Post by David Gilbert » Sun May 19, 2002 6:59 am

Hi Todd,

There are a few MAX_??? constants at the top of the CategoryPlot.java source file that set the maximum allowed values for the intro gap, trail gap, series gap and category gap. Increase them to whatever values you want.

I put those checks in a long time ago thinking they would be helpful but now I'm not so sure...what do others think about removing the checks?

Regards,

DG.

Locked