title: Dynamically create axis via ActionScript in Adobe flex charting library; Adobe Bug?
body: <p>Multiple axis creation via MXML works fine:
  <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html" rel="nofollow noreferrer">http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html</a></p>
  
  <p>But when I'm trying dynamically create horizontal and vertical axis then I'm getting extra axes. I believe this is Adobe bug. How I can fix this behavior? Thanks.</p>
  
  <p><img src="https://i.stack.imgur.com/vOWzD.png" alt="enter image description here"></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:Application 
      minHeight="600"
      minWidth="955"
      creationComplete="application1_creationCompleteHandler(event)"
      xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"&gt;
      &lt;fx:Script&gt;
          &lt;![CDATA[
              import mx.charts.AxisRenderer;
              import mx.charts.LinearAxis;
              import mx.charts.series.ColumnSeries;
              import mx.charts.series.LineSeries;
              import mx.collections.ArrayCollection;
              import mx.events.FlexEvent;
  
              [Bindable] public var SMITH:ArrayCollection = new ArrayCollection([{date:"22-Aug-05", close:41.87},
                                                                                 {date:"23-Aug-05", close:45.74},
                                                                                 {date:"24-Aug-05", close:42.77},
                                                                                 {date:"25-Aug-05", close:48.06},]);
  
              [Bindable] public var DECKER:ArrayCollection = new ArrayCollection([{date:"22-Aug-05", close:157.59},
                                                                                  {date:"23-Aug-05", close:160.3},
                                                                                  {date:"24-Aug-05", close:150.71},
                                                                                  {date:"25-Aug-05", close:156.88},]);
  
              protected function application1_creationCompleteHandler(event:FlexEvent):void
              {
                  // VERTICAL AXIS
                  var verticalAxis1:LinearAxis = new LinearAxis();
                  var verticalAxis2:LinearAxis = new LinearAxis();
  
                  var verticalAxisRenderer1:AxisRenderer = new AxisRenderer();
                  var verticalAxisRenderer2:AxisRenderer = new AxisRenderer();
  
                  verticalAxisRenderer1.axis = verticalAxis1;
                  verticalAxisRenderer2.axis = verticalAxis2;
  
                  // HORIZONTAL AXIS
  
                  var horizontalAxis:LinearAxis = new LinearAxis();
                  var horizontalAxisRenderer:AxisRenderer = new AxisRenderer();
                  horizontalAxisRenderer.axis = horizontalAxis;
                  horizontalAxisRenderer.placement = "bottom";
  
                  // SERIES
  
                  var newSeries:Array = new Array();
  
                  var columnSeries:ColumnSeries = new ColumnSeries();
                  columnSeries.dataProvider = SMITH;
                  columnSeries.yField = "close";
                  columnSeries.verticalAxis = verticalAxis1;
                  columnSeries.displayName = "SMITH";
                  newSeries.push(columnSeries);
  
                  var lineSeries:LineSeries = new LineSeries();
                  lineSeries.dataProvider = DECKER;
                  lineSeries.yField = "close";
                  lineSeries.verticalAxis = verticalAxis2;
                  lineSeries.displayName = "DECKER";
                  newSeries.push(lineSeries);
  
                  // CHART
  
                  myChart.verticalAxisRenderers = [verticalAxisRenderer1, verticalAxisRenderer2];
                  myChart.horizontalAxisRenderers = [horizontalAxisRenderer];
                  myChart.series = newSeries;
              }
          ]]&gt;
      &lt;/fx:Script&gt;
  
      &lt;mx:Panel title="Column Chart With Multiple Axes"&gt;
          &lt;mx:ColumnChart id="myChart"
              showDataTips="true"/&gt;
          &lt;mx:Legend dataProvider="{myChart}"/&gt;
      &lt;/mx:Panel&gt;
  &lt;/s:Application&gt;
  </code></pre>