0 Replies Latest reply on Jul 19, 2012 3:58 PM by tjnelso

    Maintaining X-Axis Values

    tjnelso Level 1

      I am trying to create a column chart from the following data with 'day' as the x-axis and 'sixes', 'sevens', and 'eights' as stacked series for the y-axis. Initially the data provider is 'arrayOne' but it then switches to 'arrayTwo' based on a timer. However, notice that in 'arrayOne' a value for day 3 is missing and in 'arrayTwo' a value for day 5 is missing. Right now, the x-axis gets redrawn to only fit days in the array acting as the dataProvider. I want the x-axis to remain constant when the data changes though. Is there any way I can make that happen?


      private var arrayOne:ArrayCollection = new ArrayCollection([
      protected var arrayTwo:ArrayCollection = new ArrayCollection([


      //This function is called by the horizontal axis
      private function categoryLabelFunction(labelValue:Object, previousValue:Object, axis:IAxis):String
            var index:int = int(labelValue);
            if(index >= 0 && index < nodesWipChart.dataProvider.length)
                  return nodesWipChart.dataProvider[index].day;
            return "";


      //This is the portion of my code creating the horizontal axis
            <!-- This linear axis simulates a category axis to allow zooming -->
            <mx:LinearAxis id="daysOut"
                                   title="Days to Fab Out"