Category chart: how to insert an empty space on the X axis??

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
fjanon
Posts: 9
Joined: Wed Feb 24, 2010 11:17 am
antibot: No, of course not.

Category chart: how to insert an empty space on the X axis??

Post by fjanon » Mon May 17, 2010 11:08 am

Hi,

I need to separate some box and whiskers items in a BoxAndWhiskersCategory chart with an empty space. I did it by inserting empty lists as shown in the code below. The chart seems to draw OK but when I draw it in an iText document and print the resulting pdf document , Acrobat reader generates an error: "An error exists on this page. Acrobat may not display the page correctly. blah blah..."

DefaultBoxAndWhiskerCategoryDataset categorydataset = new DefaultBoxAndWhiskerCategoryDataset();
List<Float> emptylist = new ArrayList<Float>(); // Causes an error when printing the pdf document
// List<Float> emptylist = null; // exception in dataset calculator
String emptyscalename = "";
if (spaceneededhere)
{
categorydataset.add(emptylist, "Actual", emptyscalename);
categorydataset.add(emptylist, "Preferred", emptyscalename);
}

Any suggestion?

Thanks,

Fred

Locked