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
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