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:
Code:
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:
Code:
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):
Code:
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.