Barchart with LogAxis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
josafassj
Posts: 10
Joined: Sat Jul 26, 2008 1:24 pm

Barchart with LogAxis

Post by josafassj » Tue Mar 17, 2009 7:32 pm

Hey guys!

I have a implementation of a LineAndShape chart with the RangeAxis as a LogAxis and it renders the chart very well. When I change the chartfactory to create a Barchart it renders the Range axis begining with zero, and plots some zeros until plot 10000. The implementation is the very same. I'm using the version 1.0.9.
Anyone can help-me?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Barchart with LogAxis

Post by paradoxoff » Wed Mar 18, 2009 9:06 am

Try

Code: Select all

((BarRenderer)renderer).setBase(0.1);//or another value that is much lower than your typical values
A BarRenderer will try to include the base in rendering, and the base defaults to 0. Obviously, 0 as lower bound of a LogAxis is not possible (unless you can handle an unlimited number of ticks), and the renderer probably still tries to achieve that.

josafassj
Posts: 10
Joined: Sat Jul 26, 2008 1:24 pm

Re: Barchart with LogAxis

Post by josafassj » Wed Mar 18, 2009 12:40 pm

Thaks paradoxoff. It works perfectly.

Locked