Hi all,

I've been experimenting with Ely Greenfield's excellent
'InteractiveBubble' chart, and I think I've found a bug in the
standard Flex 3 AxisRenderer.

I modified Ely's example to use the standard AxisRenderer, and now
panning the chart causes problems when axis labels reach the edge of
the chart. Rather removing the label as soon as it will no longer fit,
the chart canvas does a strange inward resize until the labels tick
mark is reached (and then the label is removed). There's an example at
http://temp.triaddo.com/flex/axisbug - I changed the background color
to make the resize obvious.


So, with this in mind I figured I had better write a new custom
AxisRenderer (following Ely's example) that looked how I need it to
look. Unfortunately, I can't make Ely's example work with Flex 3. It
runs fine out of the box, but there are deprecation warnings on the
<horizontalAxisRenderer> and <verticalAxisRenderer> tags.

I updated them to the Flex 3 array syntax for renderers, and changed
the appropriate lookup in PanAndZoom.as (line 34).

It compiles nicely, but I get an ugly runtime error as the chart loads:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
        at
mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2087]
        at
mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355]
        at
mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6214]
        at
mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602]
        at
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:657]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at
mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]
        at
mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]

This example is posted at http://temp.triaddo.com/flex/rendererbug. It
crashes immidiately, but the source is available.

(Ely, if you're reading this - I tried to add the latter half of this
post in the comments on your blog post, but got only "Sorry. You're
looking for something that isn't here". I hope that doesn't mean
you've stopped blogging!)



So I'm a bit stuck. Can someone confirm that the first example is a
bug in Adobe's AxisRenderer? If so and it's unreported, I'll happily
put it into the bug tracker.

Are there any Flex 3 examples of defining custom AxisRenderers, or
ways to address the runtime error above?

Many thanks,
Matt.

Reply via email to