Ok, I have Sas Jacobs' book,  "Foundation Flex for Developers: Data
Driven Applications with PHP, ASP.NET, ColdFusion, and LCDS".  She has a
chapter on working with XML using E4X.
 
What works, for me in this case, is this:
 
dataProvider="{chartXML.lastResult.month[0].day}"
 
In fact just to see if it would work I declared 
 
public const JANUARY:int = 0;
 
and then did 
 
dataProvider="{chartXML.lastResult.month[JANUARY].day}"
 
This worked too.
 
  HOWEVER, I have been told that using brackets is too hard to debug.
and that I should use a result handler to wrap the xmllist in an
XMLListCollection instance variable and bind to that. Sas also covers
that.  I'll read up on that and let you know.  OK, read it. I'm using
the <mx:HTTPService> and, as far as I can tell from Sas' book, the
HTTPService tag apparently takes care of creating an XMLListCollection
for you.....or maybe it just creats an XMLList.  Can anybody shed some
light on this?
 
I also learned (from the book) that the following should work:
 
dataProvider="{chartXML.lastResult.month.(@month_name=="01").day}"
 
However, it doesnt as I get the following error:
 
Element Type "mx:LineChart" must be followed by either attribute
specifications, ">" or "/>".
 
 
brad
 
brad


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Abyss Knight
Sent: Friday, February 01, 2008 3:11 PM
To: [email protected]
Subject: [flexcoders] Re: Need IF Logic for Chart Data Provider



One option would be to change the chart's viewable area, as in modify
the start of the axes to only show the data you want to show. This
would obviously put a strain on the client if there was far too much
data loaded into an ArrayCollection though.

The other option is to query the XML using e4x and use the result as
the data provider:
http://www.onflex. <http://www.onflex.org/ted/2006/12/xmle4x-vs-amf.php>
org/ted/2006/12/xmle4x-vs-amf.php

Hope that helps,
-- William

--- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com, "Brad Bueche" <[EMAIL PROTECTED]> wrote:
>
> The problem (in short):
> I need to be able to hook up my charts to dataproviders where
> <month_name> equals "January". And only pull that. I dont need it to
> read every month in the hierarchy. Or month_name is January and
day_name
> is '14'. In order to do this I need to do IF logic with the
dataprovider
> it seems to me. My other post occurred because in leiu of being able
> to do "IF month_name='January'. I have just gone in and changed the
> xml so that instead of <month> </month> [...] it now says <january>
> </january><february></february> etc. That sort of defeats the data
> description aspect of XML (it seems to me). 
> 
> 
> The background (if you are interested):
> This problem has to do with me NOT wanting to write 100+ reports to
> generate 100+ separate xml files to access.
> 
> I need to track the metrics of several internal groups over the year
via
> charting. I want to drill down into individual months (by day) and --
> maybe, days by hour. I also want to track into the sub groups per
> month and per day-in-month for each of these groups as well.
> 
> The data is network event traffic and doing the queries live will just
> not work. Users wont use the slicing and dicing visualization affords
if
> they have to wait every time the click an item.
> 
> So, I know I can save myself a lot of reports by putting all the data
> into about 10 - 20 reports or so by using the XML as its supposed to
be
> used (i.e. describing the data). I need to be able to hook the data
> provider to only a sub-node in the xml hierarchy and not have it read
> everything at that level. I need it to read only has long as
> month_name=January or month_name=January AND day_name='15'.
>



 

Reply via email to