disable negatives values on lineChart with zoom

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Alex4924
Posts: 6
Joined: Wed Nov 23, 2011 10:51 am
antibot: No, of course not.

disable negatives values on lineChart with zoom

Post by Alex4924 » Wed Nov 23, 2011 11:02 am

Hello everybody,

For beginning I specify to you that I am French so sorry for my English.

I've a problem with a LineChart graph who is create dynamically. This graph contain mouse wheel Zoom.
The x-axis contains date values, and the y-axis contains numeric values.

And I want to disable negatives values on the y-axis when I zoom. I don't want that when I zoom out, my graph drops below zero at the y-axis

I hope I was clear.

Thank you.

maryan
Posts: 7
Joined: Thu Dec 01, 2011 9:53 am
antibot: No, of course not.

Re: disable negatives values on lineChart with zoom

Post by maryan » Thu Dec 01, 2011 10:31 am

Hey, did you fix this?

Alex4924
Posts: 6
Joined: Wed Nov 23, 2011 10:51 am
antibot: No, of course not.

Re: disable negatives values on lineChart with zoom

Post by Alex4924 » Thu Dec 01, 2011 10:58 am

Hello,

No I didn't fix this problem and I didn't have any answer!

maryan
Posts: 7
Joined: Thu Dec 01, 2011 9:53 am
antibot: No, of course not.

Re: disable negatives values on lineChart with zoom

Post by maryan » Fri Dec 02, 2011 3:16 pm

As I wrote in another post, you can try to override zoomOutBoth method from ChartPanel. That's work for me.

mkivinie
Posts: 51
Joined: Wed Jul 06, 2005 8:35 am

Re: disable negatives values on lineChart with zoom

Post by mkivinie » Mon Dec 05, 2011 11:49 am

If you are going to show only positive Y-values why not use the NumberAxis method

Code: Select all

setRangeType(RangeType.POSITIVE)
for your Y-axis? This way the zoom out will not slip into negative range.

mkrauskopf
Posts: 31
Joined: Thu May 27, 2010 4:23 pm
antibot: No, of course not.

Re: disable negatives values on lineChart with zoom

Post by mkrauskopf » Tue Dec 06, 2011 10:36 am

setRangeType solution does not seem to work once the user starts zooming out - plot will display area below zero.

I've posted another tip into: viewtopic.php?f=3&t=109509#p167219

Locked