1 Reply Latest reply on Apr 19, 2008 4:43 PM by jylaxx

    Charting using ActionScript and chart height,width and axis labels

    LittleMuscle
      hello, i am creating charts using action script but can't seem to do 2 things right now. 1. put labels on the axisis. 2. i can't set the height/width to 100%. does anyone know how?...below is the function i use to create the charts

      public var myChart:BarChart;
      public var series1:BarSeries;
      public var legend1:Legend;
      private function addGraph():void {

      // Create the chart object and set some
      // basic properties.
      myChart = new BarChart();
      myChart.showDataTips = true;
      myChart.dataProvider = feedRequest.lastResult.root.data;

      // Define the category axis.
      var vAxis:CategoryAxis = new CategoryAxis();
      vAxis.categoryField = yAxis;
      vAxis.dataProvider = feedRequest.lastResult.root.data;
      myChart.verticalAxis = vAxis;
      myChart.width=100;
      myChart.height=100;


      var la = new LinearAxis;


      // Add the series.
      var mySeries:Array=new Array();
      series1 = new BarSeries();
      series1.xField=xAxis;
      series1.yField=yAxis;
      series1.displayName = xAxis;
      mySeries.push(series1);

      myChart.series = mySeries;

      // Create a legend.
      legend1 = new Legend();
      legend1.dataProvider = myChart;

      // Attach chart and legend to the display list.
      chartWindow.addChild(myChart);
      chartWindow.visible=true;

      }