0 Replies Latest reply on Jun 28, 2011 12:02 PM by Cr99

    Flex column chart in actionscript

    Cr99 Level 1

      The following code is based on a routine that up until recently was working. I modified it so that it would be easier to fit into a forum post.

       

      I need to do this in actionscript because the charts are created on the fly. The following code simply gives a blank chart.  What am I doing wrong?

       

      public function makeDummyChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel):void {

                 
      var renderers:ArrayCollection = new ArrayCollection();
                  genericChart
      = new ColumnChart();

                 
      // Define the two axes.
                 
      var dispAxis:CategoryAxis = new CategoryAxis();
                 
      var axr:AxisRenderer = new AxisRenderer();             
                  axr
      .axis = dispAxis;
                  renderers
      .addItem(axr);

                 
      var seriesList:ArrayCollection=new ArrayCollection();

                 
      // Add the series
                  genericChart
      .horizontalAxis = dispAxis;
                 
      var columnSeries:ColumnSeries = new ColumnSeries();    
                 
      BindingUtils.bindProperty(columnSeries, "dataProvider", this, "columnDat");

                  columnSeries
      .xField="signalID";;
                  columnSeries
      .yField="point2";
                  seriesList
      .addItem(columnSeries);

                  genericChart
      .series = seriesList.toArray();
                  genericLegend
      .dataProvider = genericChart;

                  genericChart
      .horizontalAxisRenderers = renderers.toArray();

                  genericLegend
      .dataProvider = genericChart;
                 
      // chart panel is just the panel on the screen where chart is displayed
                  chartPanel
      .addChild(genericChart);
                      trace
      ("  make dummy chart done");

             
      }