My application grew too large to pull a snippet out of as well.  I began
to put a sample application together but while doing so found where my
error stemmed from.  I got the error when the numeric data points on the
chart were of values greater than 6 digits.  What fixed it for me was
setting the canDropLabels property of AxisRenderer to false.  It appears
that the values were too large so the AxisRenderer was dropping those
labels, and when it tried to calculate the vertical gutters to make room
for the labels, the labels that were dropped were then null, causing a
null object reference error.  I hope this helps you as well.

 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of EddieBerman
Sent: Wednesday, July 22, 2009 11:47 AM
To: [email protected]
Subject: [flexcoders] Re: AxisRenderer Error #1009: Cannot access a
property or method of a null object reference

 

  

I have no solution for you, but have come across this problem as well.
If you have a simple app that demonstrates this error, you should create
a new bug on the Adobe Bug Base and attach the code. My app is too huge
at this point, and I haven't yet distilled it down to a submittable
size.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Chad Callahan" <chad.calla...@...> wrote:
>
> I am using a ColumnChart with a ColumnSet of type "stacked". If I
> switch this ColumnSet.type property to "100%" then it works just as
> expected, but when I use the "stacked" type, I get the following:
> 
> 
> 
> 
> 
> 
> 
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> 
> at
>
mx.charts::AxisRenderer/calcVerticalGutters()[C:\work\flex\dmv_automatio
> n\projects\datavisualisation\src\mx\charts\AxisRenderer.as:2055]
> 
> at
>
mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\work\flex\dmv_automa
> tion\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1845]
> 
> at
>
mx.charts::AxisRenderer/adjustGutters()[C:\work\flex\dmv_automation\proj
> ects\datavisualisation\src\mx\charts\AxisRenderer.as:1534]
> 
> at mx.charts::AxisRenderer/set
>
gutters()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\
> charts\AxisRenderer.as:836]
> 
> at
>
mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\work\flex\d
>
mv_automation\projects\datavisualisation\src\mx\charts\chartClasses\Cart
> esianChart.as:2110]
> 
> at
>
mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\work\flex\
>
dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\Car
> tesianChart.as:1366]
> 
> at mx.core::UIComponent/validateDisplayList()
> 
> at mx.managers::LayoutManager/validateClient()
> 
> at mx.core::UIComponent/validateNow()
> 
> at com.deere.jdlink.view.dashboard.pod::UltimatePod/set
> data()[C:\Documents and Settings\chad.callahan\My
>
Documents\clients\deere\jdlink\repository\trunk\development\flex\src\com
> \deere\jdlink\view\dashboard\pod\UltimatePod.mxml:109]
> 
> at spark.components::DataGroup/updateRenderer()
> 
> at
>
spark.components::DataGroup/http://www.adobe.com/2006/flex/mx/internal::
<http://www.adobe.com/2006/flex/mx/internal::> 
> itemAdded()
> 
> at spark.components::DataGroup/initializeDataProvider()
> 
> at spark.components::DataGroup/commitProperties()
> 
> at mx.core::UIComponent/validateProperties()
> 
> at mx.managers::LayoutManager/validateProperties()
> 
> at mx.managers::LayoutManager/doPhasedInstantiation()
> 
> at
> mx.managers::LayoutManager/doPhasedInstantiationCallback()
> 
> 
> 
> 
> 
> Which is thrown from AxisRenderer line 2055
> 
> 
> 
> private function calcVerticalGutters(width:Number,
> 
> leftGutter:Number,
> 
> rightGutter:Number,
> 
> firstLabel:ARLabelData,
> 
> lastLabel:ARLabelData,
> 
> adjustable:Object):Object
> 
> {
> 
> var labelAlignOffset:Number = this.labelAlignOffset;
> 
> var axisLength:Number = width - leftGutter - rightGutter;
> 
> 
> 
> var LS:Number = firstLabel.height * labelAlignOffset;
> 
> var RS:Number = firstLabel.height * (1 - labelAlignOffset);
> 
> var P1:Number = firstLabel.position;
> 
> var P2:Number = 1 - lastLabel.position;
> <-------(line 255)
> 
> 
> 
> 
> 
> 
> 
> The error is being thrown because lastLabel is null. Can anyone think
> of how lastLabel could possibly be null? 
> 
> 
> 
> Thanks,
> 
> Chad
>



Reply via email to