2010-04-06 102 views

回答

0

如果你想查看源代码,这是我做的。

覆盖保护功能 的updateDisplayList(参数unscaledWidth:数字,unscaledHeight属性:编号):无效 { super.updateDisplayList(参数unscaledWidth,unscaledHeight属性);

 var fill:IFill; 
     var state:String = ""; 

     if (_data is ChartItem && _data.hasOwnProperty('fill')) 
     { 
      state = _data.currentState; 
      fill = _data.fill; 
     }  
     else 
      fill = GraphicsUtilities.fillFromStyle(getStyle('fill')); 

     var color:uint; 
     var adjustedRadius:Number = 0; 

     color = ColorUtil.adjustBrightness2(GraphicsUtilities.colorFromFill(fill),-20); 
     fill = new SolidColor(color);  
     adjustedRadius = getStyle('adjustedRadius'); 
     if (!adjustedRadius) 
      adjustedRadius = 0; 


     var stroke:IStroke = getStyle("stroke"); 

     var w:Number = stroke ? stroke.weight/2 : 0; 

     var rc:Rectangle = new Rectangle(w - adjustedRadius, w - adjustedRadius, width - 2 * w + adjustedRadius * 2, height - 2 * w + adjustedRadius * 2); 

     var g:Graphics = graphics; 
     g.clear();  
     g.moveTo(rc.left,rc.top); 
     if (stroke) 
      stroke.apply(g); 
     if (fill) 
      fill.begin(g,rc); 
     g.lineTo(rc.right-5,rc.top); 
     g.lineTo(rc.right-5,rc.bottom); 
     g.lineTo(rc.left+5,rc.bottom); 
     g.lineTo(rc.left+5,rc.top); 
     if (fill) 
      fill.end(g); 

}