3D Bar Chart - How To Show Zero Value Item

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mjacobsca
Posts: 16
Joined: Thu Aug 21, 2003 4:59 pm

3D Bar Chart - How To Show Zero Value Item

Post by mjacobsca » Fri Jun 30, 2006 6:21 pm

I've tried looking for this answer, but can't quite find the right way to do this.

How can I force a zero value item to show up in a 3D bar chart? I don't like the empty space, and I'd like to show a flat color square while in 3D mode to indicate that the item was there.

Can I do this? I've tried "auto-range includes 0" and a minimum range axis of 0, but to no avail. I assume I am doing something wrong.

Any help would be appreciated!

Thanks in advance,

Michael

balpo
Posts: 2
Joined: Thu Jul 06, 2006 10:03 pm

perhaps this fits

Post by balpo » Thu Jul 06, 2006 11:30 pm

I had the same problem. You should use the 'Base' Property of the BarRenderer, for example:

Code: Select all

BarRenderer3D barRenderer = (BarRenderer3D) plot.getRenderer();
barRenderer.setItemMargin(-1.5d);
barRenderer.setItemLabelGenerator(new LabelGenerator());
barRenderer.setItemLabelsVisible(true);
barRenderer.setDrawBarOutline(false);
barRenderer.setMinimumBarLength(-1.5d);
barRenderer.setBase(-.0000000001d);
With this

Code: Select all

barRenderer.setBase(-.0000000001d);
the Zero values are shown as a flat bar. Play with the numbers to see which value helps you.

Hope this helps. :wink:

Balpo.

Locked