4 Replies Latest reply on Aug 25, 2010 9:20 PM by Yozef0

    Flex FillFunction

    priyaram1
      Hi,

      My flex coulmn chart needs to display the columns within a single series in diffrent colors based on a string value.
      I'm calling a web method that returns the string value to Flex ActionScript File.Now i tried calling the web method( that fetches the string value) inside the fillfunction() of the column chart and specifying the color based on the string value returned by my web method.This is not working............can anyone help me with this?

        • 1. Re: Flex FillFunction
          Level 7

          "priyaram1" <webforumsuser@macromedia.com> wrote in message
          news:gipsgl$pfc$1@forums.macromedia.com...
          > Hi,
          >
          > My flex coulmn chart needs to display the columns within a single series
          > in
          > diffrent colors based on a string value.
          > I'm calling a web method that returns the string value to Flex
          > ActionScript
          > File.Now i tried calling the web method( that fetches the string value)
          > inside
          > the fillfunction() of the column chart and specifying the color based on
          > the
          > string value returned by my web method.This is not working............can
          > anyone help me with this?

          No, it wouldn't, because the fillFunction can't wait for the result to come
          back before it has to return a result.

          HTH;

          Amy


          • 2. Re: Flex FillFunction
            priyaram1 Level 1
            Could you please suggest me an alternative approach to get the work done?
            • 3. Re: Flex FillFunction
              Level 7

              "priyaram1" <webforumsuser@macromedia.com> wrote in message
              news:gish1m$4kc$1@forums.macromedia.com...
              > Could you please suggest me an alternative approach to get the work done?

              Ask for the data before you ever draw the chart. Draw the chart after the
              resultEvent fires.


              • 4. Re: Flex FillFunction
                Yozef0 Level 1
                <mx:BubbleSeries id="bbChartSeries" xField="price" yField="rating" radiusField="popularity"
                                 itemRenderer="RolloverRenderer" fillFunction="myFillFunction" /> <!--/* fills="color" */-->
                
                
                
                
                
                private function myFillFunction(item:ChartItem, index:Number):IFill {
                     return new SolidColor(0x0000FF); // Does Not Do Anything
                }
                
                

                 

                 

                This Does Not Work. I am using Flex SDK 3.5.

                 

                the fillFunction (nor the fills with array of uint colors) of the BubbleSeries (or any other Chart) does Not Work. I am doing it exactly like the example on the live docs.

                 

                The way I load the Chart is on CreationComplete of the class its in:

                 

                // Converting XML to Objects
                protected function onCreationComplete(event:FlexEvent):void {
                    _data = [];
                    for each (var o:XML in products..sample) {
                      var _o:Object = new Object();
                          _o.id = o.@id.toString();
                          _o.description = o.@description.toString();
                          _o.rating = o.@rating.toString();
                          _o.price = o.@price.toString();
                          _o.popularity = o.@popularity.toString();
                          _o.age = o.@age.toString();
                          _o.imageUrl = o.@imageUrl.toString();
                          _o.url = o.@url.toString();
                          _o.isDefault = o.@isDefault.toString();
                          _data.push(_o);
                     }
                     bbChart.dataProvider = _data;
                     bbChart.addEventListener(FlexEvent.UPDATE_COMPLETE, _takeSnapshot);
                }
                
                

                 

                 

                If anyone is noticing something I don't. Please notity.