Right.  I'd like to basically return an array of arrays, visually organized 
like a spread sheet.  So the xField might point to column 0 (the first array) 
and yField to column 1.  For then next series, xField would still be column 0 
and yField would be column 2, etc.

As far as the actual way to pull this off in java, I'm not sure how to do it in 
a way that flex will recognize as an associative array (like the 
Month:"January", Profit:2000, Expenses:1500, Amount:450 from the first example).


--- In [email protected], Josh McDonald <j...@...> wrote:
>
> But what will the objects be that you're sending back? You can't make a
> chart out of a list of numbers, it'd be one-dimensional, not to mention not
> very useful :)
> 
> -Josh
> 
> 2009/3/18 netdeep <deep...@...>
> 
> >
> > I'll be sending Dates, Strings, and floats.
> >
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>, Josh
> > McDonald <josh@> wrote:
> > >
> > > What kind of objects are in your array?
> > >
> > > -Josh
> > >
> > > 2009/3/17 netdeep <deepnet@>
> >
> > >
> > > > In the flex documentation, it shows how to easily create a chart with
> > > > mxml and a static Array:
> > > >
> > > > private var expenses:Array = [
> > > > {Month:"January",Profit:2000,Expenses:1500,Amount:450},
> > > > {Month:"February",Profit:1000,Expenses:200,Amount:600},
> > > > {Month:"March",Profit:1500,Expenses:500,Amount:300},
> > > > ];
> > > > <mx:ColumnSeries
> > > > xField="Month"
> > > > yField="Profit"
> > > > displayName="Profit"
> > > > />
> > > > <mx:ColumnSeries
> > > > xField="Month"
> > > > yField="Expenses"
> > > > displayName="Expenses"
> > > > />
> > > >
> > > > But I am reading my data from the database and want to pass the data
> > via a
> > > > java object. But I don't know the number of fields at runtime. So how
> > do I
> > > > assign the xFields and yFields since I won't be able to create a
> > variable
> > > > named "Month" or "Profit"? I'll just have an array of floats or dates
> > or
> > > > whatever. Here's a start put I have no idea how to plug in the missing
> > > > pieces or if another route would be preferable.
> > > >
> > > > var lineSeries:LineSeries = new LineSeries();
> > > > BindingUtils.bindProperty(lineSeries, "dataProvider", ser,
> > "javaArray");
> > > > // lineSeries.xField= ???
> > > > // lineSeries.yField= ???
> > > >
> > > > The data set is often quite large by the way.
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > "Therefore, send not to know For whom the bell tolls. It tolls for thee."
> > >
> > > Josh 'G-Funk' McDonald
> > > - josh@
> > > - http://twitter.com/sophistifunk
> > > - http://flex.joshmcdonald.info/
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
> 
> Josh 'G-Funk' McDonald
>   -  j...@...
>   -  http://twitter.com/sophistifunk
>   -  http://flex.joshmcdonald.info/
>


Reply via email to