JFreeChart, equal axes

jeff.lyons_at_ngc.com
Date: 02/28/05


Date: 28 Feb 2005 08:17:07 -0800

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



Relevant Pages

  • Re: Placing shapes exactly on charts.
    ... The Plot area includes all tick-label properties that exist on the "outside" ... In effect the Plot-area includes an outer area and inner area. ... the X & Y axes. ... Dim cht As Chart ...
    (microsoft.public.excel.charting)
  • Re: key performance indicator
    ... A statisticus made a key performance indicator graph ... > Y axes: ... > So every item in the scale is plotted by its mean via the Y axes and by ... So you seem to have something about the importance ...
    (sci.stat.edu)
  • Re: semilog in linux
    ... I can set the axes scales, but why don't the functions work? ... Did you use HOLD ON to "lock" the axes in linear scale before calling the ... The phrase "certain axes properties" includes the XScale, YScale, and ZScale ...
    (comp.soft-sys.matlab)
  • Re: Wrap by plot by 90?
    ... instead of the plus/minus 180-deg scale. ... Axes can, however, be relabelled arbitrarily by setting the ... XTick, YTick, or ZTick properties to the locations you want the ... or ZLabel properties to the strings you want those labels to show up as ...
    (comp.soft-sys.matlab)
  • Re: How to make two charts look exactly the same?
    ... inside plot area (defined by the axes), even if the "regular" plot area ... > do is just create one chart that is based on a named range, ...
    (microsoft.public.excel.charting)