This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JFreeChart zoom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFreeChart zoom" Watch "JFreeChart zoom" New topic
Forums: Swing / AWT / SWT Other JSE/JEE APIs
Author

JFreeChart zoom

Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 108
Hi,

I'm creating a XYLineChart which is built using a XYSeriesCollection which contains two XYSeries. For each x, the y values are too close to each other in these two graphics represented by the XYSeries objects. The difference between them is always under 0.1. The range for the Y values is 0-2000. When I look at the JPG file created, I can barely see the two graphics: one of them is practically hidden by the other. What I'd like is some kind of zoom so the little variations could be seen. I'm not sure whether it would be feasible to alter the scale somehow or maybe changing the JPG dimensions would help. Any suggestions, please?


I see wind mills
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

I've only used JFreeChart indirectly through Jasper Reports, but I know you are able to set the Y-axis scale. A quick Google search suggests that you want the setRange() method in the ValueAxis class or one of its subclasses. There also seems to be a way to set it so the range is determined automatically based on the data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFreeChart zoom
 
Similar Threads
loops in java to produce shapes
Image not getting painted.
Is there a way to globally change a variable for many classes?
Repainting /clipping area?
Problem with zoom function