JFreeChart, equal axes

J

jeff.lyons

I've been using JFreeChart a while, but have hit a problem I can't
solve. I have an XYPlot where I want the x and y axes on the same
scale, regardless of my ChartPanel size. I want the user to be able to
zoom in, but the program should detect the zoom window and adjust it so
the axes scale is the same for x and y. I hoped there would be a
setting to do this. Plot.get/setDataAreaRatio looked encouraging, but
when this didn't work I searched the source and found that ContourPlot
was the only class that used this. So I figured I'd scale the axes on
my own.

My problem isn't the calculation to do this, but getting the data I
need. I need to get just the height and width of the area of the plot
data. I think the code calls this the dataArea. But XYPlot does not
give me access to this. I've extended XYPlot and over-written its draw
methods to catch the plot area argument, but I think this includes axes
and everything else.

Is there an easier way to do this? If not, how do I get the area of
just the plotted data?

thanks,
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top