For anyone interested, I'm found a fairly good way to do this.  On resize of
your chart, call the following function.  You'll need to have the max and
min values for X and Y.  Best to calculate those ahead of time rather than
in this function, as it will get called a lot as you resize.  Also, this
really only makes sense for LinearAxes.

private function syncAxes(axis1: AxisRenderer, axis2: AxisRenderer,
    maxAxis1: Number, minAxis1: Number, maxAxis2:Number,
minAxis2:Number):void
{
  var axis1Scale:Number = maxAxis1 - minAxis1;
  var axis2Scale:Number = maxAxis2 - minAxis2;

  if (axis1Scale * axis2.length / axis1.length < axis2Scale)
  {
    LinearAxis(axis1.axis).minimum = minAxis1;
    LinearAxis(axis1.axis).maximum = minAxis1 + axis2Scale * axis1.length /
axis2.length;

    LinearAxis(axis2.axis).minimum = minAxis2;
    LinearAxis(axis2.axis).maximum = maxAxis2;
  }
  else
  {
    LinearAxis(axis1.axis).minimum = minAxis1;
    LinearAxis(axis1.axis).maximum = maxAxis1;

    LinearAxis(axis2.axis).minimum = minAxis2;
    LinearAxis(axis2.axis).maximum = minAxis2 + axis1Scale * axis2.length /
axis1.length;
  }
}


On Thu, Sep 4, 2008 at 1:09 AM, Pan Troglodytes <[EMAIL PROTECTED]>wrote:

> I'm trying to get both the vertical and horizontal axis on a chart to match
> unit sizes.  In other words, I want the distance from 0 to 1 to be the same
> on both axes.  With gridlines turned on, this would make the gridlines form
> perfect squares.  What's the best way to go about forcing that?
>
> --
> Jason
>



-- 
Jason

Reply via email to