Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-17-2012, 04:32 PM   #1
Registered User
Join Date: Jun 2012
Posts: 35
Default Help with Code for Formatting Data

I am working on a project in which I need to get data from an embedded csv file into chart components in Flash Builder. The data in the csv file is in the following format, where the following each represent a column:

Date    PartType    Step    WIP    Projection
So a row in my csv table would represent the total amount (WIP) of a given part type (PartType) sitting at a particular step (Step) at a certain point in time (Date), along with a projection of what that wip amount was suppose to be (Projection). But for any date/step combination there may be several part types with wip sitting there.

What I am trying to create is a stacked column chart component for which the x-axis is steps and the y-axis is Wip, so at any step the wip associated with a given part type is shown. From what I have learned of Flash Builder/Flex, in order to populate the chart I need to get the above csv file data into the following arrayCollection format:

var data:ArrayCollection = new ArrayCollection([

{Date: a, Step: b, PT1wip: 5, PT2wip: 6, PT3wip: 7, PT1proj: 8, PT2proj: 9, PT3proj: 10}
{Date: a, Step: c, PT1wip: c, PT2wip: 2, PT3wip: 3, PT1proj: 4, PT2proj: 5, PT3proj: 6h}
{Date: a, Step: d, PT1wip: 1, PT2wip: 5, PT3wip: 4, PT1proj: 3, PT2proj: 2g, PT3proj: 1}
I have been able to code it so that I have an array as follows (ignoring the projections):

var data:ArrayCollection = new ArrayCollection([

{Date: a, Step: b, {{PartType: PT1, wip: 5}, {PartType: PT2, wip: 6}, {PartType: PT3, wip: 7}};
{Date: j, Step: k, {{PartType: PT1, wip: 2}, {PartType: PT2, wip: 4}, {PartType: PT3, wip: 3}};
But I can't get from here to the desired output. Is there any other way to manage the data, or does anyone know how I can achieve the desired result?

Thanks so much to anyone that can help.
tnel is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:41 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.