I'm having trouble displaying a subset of my XML data structure when I
drill down in a simple Column Chart. I'm not sure if my problem is in
my e4x notation, or possibly just miss management of my XMLList or
XMLListCollection.
What I'm trying to do is use a Bindable XMLListCollection to be
displayed in a Column Chart. When a column is clicked a subset of the
XML is shown based on the click (hits in a week to drill down to hits
in a day). I have the data displaying correct at load, however on a
click I catch the column click and the charts updates as desired...
the problem is it uses incorrect data (lol... no data).
Here is the code that creates the chart.
______________________________________________________
<mx:ColumnChart
id="columnChart"
dataProvider="{statCol}" width="100%" height="100%"
showDataTips="true" itemClick="drillDown(event);">
<mx:verticalAxis>
<mx:LinearAxis/>
</mx:verticalAxis>
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{statCol}"
categoryField="@date" />
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries id="columnSeries"
showDataEffect="slideIn" hideDataEffect="slideOut"
yField="@hits" displayName="Hits"/>
</mx:series>
</mx:ColumnChart>
_______________________________________________________
Here is the action script that works with the chart to produce the
drill down subset. The problem is that I can't display my subset of
weeks -> days. I believe my relationship to the attributes in the
chart is correct and thus leads me to believe that my manipulation of
the xml is incorrect. I have gotten the chart to work partically with
a hardcoded XML dataset here, but it still was not completely correct.
public function drillDown(e:ChartItemEvent):void
{
statCol = new XMLListCollection(e.hitData.item.week);
}
_________________________________________________________
Here is an example of my XML Data.
<root>
<week date="10/29/2006" hits="111">
<day date="10/29/2006" hits="10" />
<day date="10/30/2006" hits="12" />
<day date="10/31/2006" hits="15" />
<day date="11/01/2006" hits="19" />
<day date="11/02/2006" hits="22" />
<day date="11/03/2006" hits="11" />
<day date="11/04/2006" hits="22" />
</week>
<week date="11/05/2006" hits="148">
<day date="11/05/2006" hits="24" />
<day date="11/06/2006" hits="25" />
<day date="11/07/2006" hits="22" />
<day date="11/08/2006" hits="28" />
<day date="11/09/2006" hits="10" />
<day date="11/10/2006" hits="17" />
<day date="11/11/2006" hits="22" />
</week>
.....
</root>
Thank you all so much for your help,
Ryan
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/