1) is the area chart stacked?
 
2) As with all array properties in flash and flex, the charts don't watch the series properties for changes (arrays don't support 'watching.').  So if you just push on to the chart's series property, there's no guarantee as to when the chart will notice the change to the series, or what half-state it might be in as a result.  Instead, you should create a new array (or clone the existing series array), push onto it, and when you're done, assign it back to the series property.
 
Ely.
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark
Sent: Tuesday, August 29, 2006 3:03 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] TypeError: Error #1009 in AreaChart with variable Series

I'm trying to create an AreaChart where the number (and definition) of
series will change as the user chooses to filter the data. As the
filter changes I want it to clear all series and slide the new ones in
from the bottom. To do this I'm replacing all the series in the chart
each time the user chooses to filter:

private function setChartSeries():void
{
aChart.series = new Array();
var series:Array = getFilteredSeries();

for (var i:int = 0; i < series.length; i++) {
var s:AreaSeries = new AreaSeries();
s.yField = series[i].field;
s.setStyle("showDataEffect", slideIn);
aChart.series.push(series);
}
}

<mx:SeriesSlide id="slideIn" duration="600" direction="up"/>

It works great until I add the showDataEffect transition, at which
point it gives me the following error after filtering:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at
mx.charts.chartClasses::Series/mx.charts.chartClasses:Series::stripNaNs()
at
mx.charts.series::AreaSeries/mx.charts.series:AreaSeries::updateFilter()
at
mx.charts.chartClasses::Series/mx.charts.chartClasses:Series::validateTransform()
at mx.charts.chartClasses::Series/getRenderDataForTransition()
at mx.charts.effects.effectClasses::SeriesSlideInstance/play()
at mx.effects::EffectInstance/startEffect()
at mx.effects.effectClasses::ParallelInstance/play()
at mx.charts.chartClasses::ChartBase/::advanceEffectState()
at
mx.charts.chartClasses::ChartBase/mx.charts.chartClasses:ChartBase::updateDisplayList()
at
mx.charts.chartClasses::CartesianChart/mx.charts.chartClasses:CartesianChart::updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/::validateDisplayList()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

I did a search of the archives and I found something that looks
similar: http://groups.yahoo.com/group/flexcoders/message/42737.
Could this be the same thing? If so, what is the known fix that is
referenced here:
http://groups.yahoo.com/group/flexcoders/message/42821? If it's not
the same thing, does anybody have any ideas?

Thanks in advance for any help.

mark

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to