2 Replies Latest reply on Aug 13, 2009 12:47 PM by dr.Evol

    Charting: vertical axis position

    dr.Evol Level 1

      Hi!

       

      I need to manually position the vertical axis along the chart by setting the verticalAxisRenderer.x value.

      If I do that, it seem like chart compoenent automatically correncts the axis to be on the left side.

       

      Any ideas?

        • 1. Re: Charting: vertical axis position
          msakrejda Level 4

          If you're just looking to position it on the right, there is the 'placement' property of the AxisRenderer.

           

          --

          Maciek Sakrejda

          Truviso, Inc.

          www.truviso.com

          Truviso is hiring: http://www.truviso.com/company-careers.php?i=87

          • 2. Re: Charting: vertical axis position
            dr.Evol Level 1

            Hi,

             

            Thanks for your suggestion but I need to position the axis anywhere like axis.x=500;

             

            I was playing arround for a few hours and so far I have came to the following solution which looks promising so far:

             

            I created a custom axis renderer which extends AxisRenderer. Then I tricked the chart component that it cannot set the x value of the axisRenderer.

            So.. if anyone come the the same problem in the future, this might be a solution.

             

            package si.catalina.qos.views.reports.charts.cartesianChart
            {
                import mx.charts.AxisRenderer;

             

                public class CustomPositionAxisRenderer extends AxisRenderer
                {
                    private var _xValue:Number=0;
                   
                    public function CustomPositionAxisRenderer()
                    {
                        super();
                    }
                   
                    override public function set x(value:Number):void
                    {
                        _xValue=value;
                    }
                   
                   
                    override public function get x():Number
                    {
                        return _xValue;
                    }
                   
                    public function set xValue(value:Number):void
                    {
                        _xValue=value;       
                    }
                   
                   
                    override public function move(x:Number, y:Number):void
                    {
                        super.move(_xValue,y);           
                    }
                   
                   
                   
                   
                   
                   
                }
            }