0 Replies Latest reply on Jul 24, 2009 12:50 PM by Cr99

    Axis offsets and padding problems

    Cr99 Level 1

      I am having problems with getting my charts to draw as columns to the right of tick marks.  Here is what the chart should look like:

       

      image001.gif

       

      But here is what mine looks like in Flex:

       

      tmpImg.png

       

      Below  are snippets from my code to draw the chart in Actionscript.  As you can see, I am currently using the padding property on CartesianChart to keep the chart from clipping the columns.  Then I use offset on the columnSeries to get the columns off the labels.  But I am left with a big gap on the left...

       

      // code

       

           var genericChart:CartesianChart = new CartesianChart();

       

           var axisList:ArrayCollection = chart.getAxisList();

           var renderers:ArrayCollection = new ArrayCollection();

           var seriesArray:ArrayCollection = new ArrayCollection();

           var hAxis:LinearAxis = new LinearAxis();      

           hAxis.padding = 100;

       

          var ar:AxisRenderer = new AxisRenderer();

          ar.axis = hAxis;

          genericChart.horizontalAxisRenderers = [ar];

          genericChart.horizontalAxis = hAxis;

          var vAxis:LinearAxis = new LinearAxis();

          vAxis.baseAtZero = false;

          var axr:AxisRenderer = new AxisRenderer();

          axr.axis = vAxis;

       

          var columnSeries:ColumnSeries = new ColumnSeries();        

          columnSeries.columnWidthRatio = 90;

          columnSeries.offset = 50;

          columnSeries.verticalAxis = vAxis;

       

          seriesArray.addItem(columnSeries);

          renderers.addItem(axr);

          genericChart.series = seriesArray.toArray().reverse();

          genericChart.verticalAxisRenderers = renderers.toArray();