I'm confused as to how the dataFunction method works. Namely, I don't understand how to call the dataFunction. Here is my chart data, in the array named 'arrayOne'. I want the x-axis to populate with the 'day' items and I want stacked columns where each stacked column is the 'wip' item in a 'type' property. This would allow me to see the amount of wip corresponding to each part type on every day.

Code:
 
[Bindable] private var arrayOne:ArrayCollection = new ArrayCollection([ 
               {time:1,day:3,typeA:{wip:10,proj:15},typeB:{wip:15,proj:9},typeC:{wip:20,proj:20}}, 
               {time:1,day:2,typeA:{wip:12,proj:14},typeB:{wip:13,proj:12},typeC:{wip:12,proj:17}}, 
               {time:1,day:1,typeA:{wip:15,proj:14},typeB:{wip:12,proj:10},typeC:{wip:5,proj:9}}, ]);
In my init() function I have an arrayCollection called 'allSeries' that I'm using to create checkboxes for each part type. Since this array contains a list of all part types I would also like to use it to make a chart series for every element in the array. So I have a call to a function called 'updateChartSeries' that is defined to populate my column chart series with the elements of 'allSeries'.

Code:
protected function init():void 
{ 
      allSeries.addItem("TypeA");      //This is an array collection holding the series names 
      allSeries.addItem("TypeB"); 
      allSeries.addItem("TypeC"); 
      updateChartSeries(allSeries); 
}
The 'updateChartSeries' function is below. It takes an arrayCollection as a parameter, such as 'allSeries', and is suppose to create a column series for each element of the passed in arrayCollection. To do this it needs to recognize the part type name from my dataprovider table ('arrayOne') and assign the corresponding wip value as the column series yField. That's what I can't figure out how to do.

Code:
public function updateChartSeries(seriesArray:ArrayCollection):void 
{ 
     var mySeries:Array = new Array();  
 
     for(var i:int = 0; i < seriesArray.length; i++) 
     { 
          var legend:String = "part " + seriesArray[i].toString();  
 
          var col:ColumnSeries = new ColumnSeries(); 
          col.id = seriesArray[i].toString(); 
          col.displayName = legend; 
          col.filterData = false; 
          col.dataFunction = Function(dataFunc(col, seriesArray[i]));    //I don't know how to call the function here.  
 
          mySeries.push(col); 
     }  
 
     typeChart.series = mySeries; 
}   
 
private function dataFunc(series:Series, item:Object, fieldName:String):object 
{ 
      //I don't know what to put here! I think I want to return item.(seriesArray[i]).wip;  
}