5 Replies Latest reply on Jun 24, 2010 5:04 AM by rootsounds

    Flex 4 - Problem Displaying PieChart working in Flex 3

    matn1

      Hi

      This post goes out again and I hope someone can get to the bottom. In FB4 with Compatibility set to Flex 3 I get the following error. However, with compatibility turned off I do not get the error below. I hope a workaround can be determined.

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.charts.series::PieSeries/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\datavisu alization\src\mx\charts\series\PieSeries.as:1400]
          at mx.core::UIComponent/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8531]
          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:663]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:718]
          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]

       

      The program can be run

      http://livedocs.adobe.com/flex/3/langref/mx/charts/series/PieSeries.html

        • 1. Re: Flex 4 - Problem Displaying PieChart working in Flex 3
          David_F57 Level 5

          Hi,

           

          I just pasted the code directly into a new project created with the flex 3.5 sdk, it ran fine, I then updated the project to 4.0 sdk and it ran fine, I then disabled spark in the build options and once again it ran fine.

           

          This is on windows 7 x64, so FB seems to being handling the charting demo with no issues at all.

           

           

          David.

          • 2. Re: Flex 4 - Problem Displaying PieChart working in Flex 3
            matn1 Level 1

            Well That's very odd, because if I run it after compiling it with Flex 3.5 or 4.1 as mentioned without ver 3 compatibility turned on it does work.

             

            The problem I have is that I'd like to compile to more easily port over with the flag set on. Again I get no error during compile but when I run it I get

            the error described. So apparently the code is broken somewhere during the porting and I'd hate to rewrite my complete application over in Flex 4.

             

            Going forward I can see writing to the spec, but it should be backwards compatible?

            • 3. Re: Flex 4 - Problem Displaying PieChart working in Flex 3
              David_F57 Level 5

              Hi,

               

              for me backward compatibility is a no-no, to much drama with support, I hate legacy code and for me the moment FB 4 went public I labelled everything flex 3 legacy and started the porting.

               

              David.

              1 person found this helpful
              • 4. Re: Flex 4 - Problem Displaying PieChart working in Flex 3
                seb.dsf

                Hi,

                 

                I have the same problem with my application. I have found a workaround. The problem is that for an unknown reason the "itemRenderer" property of PieSeries is null. To solve this problem you can specify the itemRenderer property to its orignal default value.

                 

                Something like :

                <mx:PieSeries field="value"
                                       nameField="name"
                                       labelPosition="inside"
                                       itemRenderer="mx.charts.renderers.WedgeItemRenderer">
                     <mx:fills>
                          <mx:SolidColor color="0xe48701"/>
                          <mx:SolidColor color="0xa5bc4e"/>
                          <mx:SolidColor color="0x1b95d9"/>
                          <mx:SolidColor color="0xcaca9e"/>
                          <mx:SolidColor color="0x6693b0"/>
                          <mx:SolidColor color="0xf05e27"/>
                     </mx:fills>
                </mx:PieSeries>

                 

                I hope it will help.

                 

                --

                Sébastien

                De Saint Florent

                • 5. Re: Flex 4 - Problem Displaying PieChart working in Flex 3
                  rootsounds Level 4

                  Ouch...the Data Visualization package contains all kinds of fun surprises like this. You'd think Adobe would want to fix the many remaining bugs since it's a very marketable feature, but they seem to have lost interest in it. At least now it's open source, which helps a lot in sorting things out. Of course it exposes a new kind of pain from trying to figure it all out. They never bothered to clean up before going open, so the design still wreaks of being closed off (only now you can better plan workarounds). Customizing the DV components is way more difficult than it has to be.