0 Replies Latest reply on Jun 20, 2011 3:02 PM by sleblang

    Column chart: Dynamically change column data

    sleblang Level 1

      I am have a column chart that is using a custom itemrenderer for its ColumnSeries. Based upon the data of the individual column, I change the color of the column. If the data equals a specific value I also want to change the height of the individual column (along with the color). I am able to change the color of the column, however I have not  been able to change the height.

       

      override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void {
      
           super.updateDisplayList(unscaledWidth, unscaledHeight);
           
           if( data != null ){
                
                var g:Graphics = graphics;
                g.clear();
                
                if( data.item.value <=80 && data.item.value >60 ){
                     g.beginFill(0xFFC630); // yellow
                }
                      // need the value below to change / be customized;
                else if (data.item.value == 0){
                          
                          g.beginFill(0xB20000);
                          g.drawRect(0,0, unscaledWidth, 302.5);
                          g.endFill();
                          return;
                          
                          
                } 
                else if( data.item.value <=60 ){
                     
                     g.beginFill(0xB20000); // red
                }
                else {
                
                     g.beginFill(0x007F46); // greeen
                     
                }
                
                g.drawRect(0, 0, unscaledWidth, unscaledHeight);
                g.endFill();
           }
           
      }
      

       

      Thanks for any and all replies.