• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Utterly Confused About Usefulness of Actionscript

New Here ,
Jul 23, 2012 Jul 23, 2012

Copy link to clipboard

Copied

I am utterly confused. I am trying to create series dynamically, meaning that I will have a dataset that looks SOMETHING like the following:

 

[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}},

]);

BUT, the only thing I know for sure is that there will be a time and day value. TypeA, TypeB, and TypeC are product types, and they MIGHT or MIGHT NOT be in my dataset, simply depending on the result of a SQL query. So I need to be able to create chart series for typeA, typeB, and/or typeC (or any other type that I may not even know about yet) given that they appear in my dataset.

I know I need to use dataFunction, since I actually need to access the 'wip' for any given product type. I have found out that 'item' is the row of the data array that is currently being accessed, so in my dataFunction I need to return something like 'item.(series).wip'. But that isn't allowed.

private function dataFunc(series:Series, item:Object, fieldName:String):object

{

          if(fieldName == "yValue")

          {

               return item.(series).wip

           }

}

 

I am dealing with a dataset like the one I posted at the top of this post BUT I don't know what my product types will be, they could be anything. Yet I need to create a series for each product type. Actionscript seems incapable of handling this as far as I have seen thus far. I hope I am incorrect. If anyone can help please chime in!

Views

534

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 23, 2012 Jul 23, 2012

Copy link to clipboard

Copied

LATEST

Anyone from Adobe? I might be able to figure this out on my own but I can't seem to understand how dataFunction works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines