原文:http://www.flexer.cn/bbs/viewthread.php?tid=466&extra=page%3D1
<mx:AreaChart width="521" height="146" id="aChart" mouseOut="handleMouseOut(event)" mouseMove="handleMouseMove(event)"> <mx:annotationElements> <mx:Canvas id="linesCanvas" horizontalScrollPolicy="off" verticalScrollPolicy="off" /> </mx:annotationElements> </mx:AreaChart >
private function handleMouseMove(e:MouseEvent):void
{
linesCanvas.removeAllChildren();
//creating the line
var theLine:VRule = VRule(linesCanvas.addChild(new VRule()));
theLine.styleName="LineOnChart";
theLine.x = Math.round(hda[0].x)-50;
theLine.y = 0;
theLine.height = linesCanvas.height;
}