Hmm, I’m not really able to spot
anything in here. You might need to distill this down into a complete
example. Or perhaps you’ll just need to run this in a debugger (break in
the addSeries method) and see if you can figure out why the data isn’t
lining up correctly.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Dave
Sent: Friday, May 13, 2005 6:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Charting
Multiple Selections in dataGrid
CORRECTION:
ALTHOUGH MINOR, THE CORRECT EVENT SHOULD BE
change="webservice1.PulseGraphShareByCategory.send()"
JUST PASTED WRONG CODE ON LAST POST.
--- In flexcoders@yahoogroups.com,
"Dave" <[EMAIL PROTECTED]> wrote:
> Matt,
>
> Here is the code for the LineSeries if
hard-coded to chart one
> selectedItem at a time from the dataGrid:
> <mx:LineSeries
name="{Deposits.selectedItem.CATEGORY}"
> xField="SCHEDDATE"
yField="TOTALBAL"
>
showDataEffect="drillDownEffect">
>
> *Deposits is the name of the dataGrid
>
> When using this code, I attach the event
>
change="webservice1.PulseGraphLoanByCategory.send()" to the
> dataGrid.
>
> When trying to use the addSeries function, I
remove that event
> handler and replace with
change="addSeries()" and place the call
to
> the WS method in the addSeries script. That
is one thing I'm not
> sure about. Here is the addSeries script:
> function addSeries() {
>
webservice1.PulseGraphShareByCategory.send()
>
linechartDeposits.series.removeAll();
>
for (var i=0; i<Deposits.selectedIndices.length; i++)
{
>
var ls=new LineSeries();
>
ls.yField=Deposits.selectedItems[i].TOTALBAL;
>
ls.xField=Deposits.selectedItems[i].SCHEDDATE;
>
ls.name=Deposits.selectedItems[i].CATEGORY;
>
linechartDeposits.series.addItem(ls);
>
}
>
}
>
> ALSO - the name field comes back defined (in
the dataTips) but the
> yField and xField are undefined.
>
> Any help would be greatly appreciated!
>
> -Dave
>
> --- In flexcoders@yahoogroups.com,
Matt Chotin <[EMAIL PROTECTED]>
wrote:
> > Are you making sure to only add the
series after that data has
been
> > retrieved from the WS (in the result
handler)?
> >
> >
> >
> > _____
> >
> > From: flexcoders@yahoogroups.com
> [mailto:flexcoders@yahoogroups.com]
On
> > Behalf Of Dave
> > Sent: Thursday, May 12, 2005 10:23 AM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Charting Multiple
Selections in dataGrid
> >
> >
> >
> > I'm stumped. I want my chart to add a
series for each row
selected
> > from a corresponding dataGrid. I've used
the Series Selection
> example
> > (under Misc Techniques and Examples)
here
> > http://flexapps.macromedia.com/flex15/chartexplorer/explorer.mxml
> >
>
<http://flexapps.macromedia.com/flex15/chartexplorer/explorer.mxml>
> as
> > the model, but it still doesn't work.
> >
> > The dataGrid is getting data from a WS.
When a row is selected,
> the
> > CATEGORY field is used to retrieve data
from a different WS.
This
> > works fine when "hard-coding"
the LineSeries (e.g.
<mx:LineSeries
> >
name="{Deposits.selectedItem.CATEGORY}" xField="SCHEDDATE"
> > yField="TOTALBAL"
showDataEffect="drillDownEffect" />) but I
can't
> > get it to work using the addSeries
function. The different
> > categories will appear in the legend as
rows are multi-selected
> from
> > the dataGrid, but the chart is a simple
line across the top and
> the
> > dataTips are undefined.
> >
> > Any ideas???? I know I'm close but
unable to resolve.
> >
> >
> > Thanks,
> >
> > Dave
> >
> >
> >
> >
> >
> > _____
> >
> > Yahoo! Groups Links
> >
> > * To visit
your group on the web, go to:
> > http://groups.yahoo.com/group/flexcoders/
> > <http://groups.yahoo.com/group/flexcoders/>
> >
> > * To
unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >
<mailto:[EMAIL PROTECTED]
> subject=Unsubscribe>
> >
> > * Your use
of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/>
Terms of Service.
Yahoo! Groups Links