set range stackedhorizontal defaultcategorydataset

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

set range stackedhorizontal defaultcategorydataset

Post by Reid Maker » Thu Aug 15, 2002 7:13 am

Hello,

I am wondering if it is possible to set a mandatory range/axis using a defaultcategorydataset on a stackedhorizontalchart. I am using it to do a 0 - 5 progress meter, and I am currently having a 2 stacked bars, one of color, and one white in order to always have the range go up to 5. The problem is that the white part is outlined by a small black box. Is there a better way to do this, one that doesn't involve the outlined box? I am thinking I can either turn off the box, or mandatorly set the range to 5.

any help would be greatly appreciated.

Reid

David Gilbert

Re: set range stackedhorizontal defaultcategorydataset

Post by David Gilbert » Thu Aug 15, 2002 9:12 am

Just use a regular bar chart, and set a fixed range on the axis:

CategoryPlot plot = myChart.getCategoryPlot();
NumberAxis axis = plot.getRangeAxis();
axis.setRange(0.0, 5.0);

Regards,

DG.

Locked