Problem dynamic binding pieChart to ArrayCollection

Problem dynamic binding pieChart to ArrayCollection

Post by ChrisBAH10 » Fri, 18 Apr 2008 06:24:02


Rather than bind my pieChart to a static array or arraycollection, like most
examples show...I want to bind the pieChart via dataProvider to an
ArrayCollection populated via an HTTPService.

My chart result handler is:
public function chartResultHandler(event:ResultEvent):void
{
eventTaskChartAC = event.result.DATAROOT.DATAITEM as ArrayCollection;
}

Each DATAITEM should contain a NUM and a STATUS. Thus, my MXML looks as
follows:
<mx:PieChart id="taskOverviewChart" height="60%" width="80%"
dataProvider="{eventTaskChartAC}"
showDataTips="true">
<mx:series>
<mx:PieSeries
labelField="STATUS"
field="NUM"
labelPosition="callout"/>
</mx:series>
</mx:PieChart>

However, despite the fact that the HTTPService is getting called properly and
the data returned is in the proper format, the chart fails to appear.

Can anyone guide me in the right direction?

Thanks.
 
 
 

Problem dynamic binding pieChart to ArrayCollection

Post by BaliH » Fri, 18 Apr 2008 16:50:53

It looks fine. Try displaying the results in a datagrid to make sure the data is there. If it there is should show using your mxml. Also, check your capitalisation of your column names just in case.