5 Replies Latest reply on Aug 25, 2010 9:31 PM by Yozef0

    unable to dynamically fill color on bubble chart Items ?

    tcflex

      Hi All,

       

      I have a data grid and bubble chart having same copies of data providers. when ever I select a row or multiple rows on the data grid the correponding chart Items in the bubble chart should be selected. But the color of chart item should be dynamically calucalted as soon as the user selects a row in the data grid. I tried to compute the color on the event when user selects a row/multiple rows and assign the color as fill to the chart item. Even after doing this I am unable to see the color change in the bubble chart ? Quick response will be appreciated.

       

      Thanks,

      Arjun.

        • 1. Re: unable to dynamically fill color on bubble chart Items ?
          _Natasha_ Level 4

          BubbleSeries has property fillFunction with default realization. You should create your own for your purposes.

          • 2. Re: unable to dynamically fill color on bubble chart Items ?
            tcflex Level 1

            Thanks for the reply. I am using fill function which will fill the buubles on per chart Item basis. In the fill function I have the set the color and a alapha as 0.1. As soon as user selects one or more chart items, the color of the bubble changes. That is acceptable. But after deselecting the chart items they are not able to hold the alpha value . i..e. 0.1 in this case. The colors that has been painted by a fill function will not be reatined after selecting chart items.

            • 3. Re: unable to dynamically fill color on bubble chart Items ?
              tcflex Level 1

              Hi,

               

              All the fill function by default passes solid color on any of user interactions. So, it is left to us to override the default mechanism.

               

              Thanks.

              • 4. Re: unable to dynamically fill color on bubble chart Items ?
                tcflex Level 1

                Fill function is used for per item fill. Create your own renderer that will solve the problem and overiride updatedisplaylist to hve your own fills. By default the user interaction on charts will pass solid color by using its own adjust2brightness function.

                • 5. Re: unable to dynamically fill color on bubble chart Items ?
                  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.