views:

17

answers:

1

alt text

here is the pie chart from center of that i need to draw or place needle sort of thing how to do it

A: 

Something like the following should work:

var radians:Number = Math.PI;
var radius:Number = 400;
var xpos:Number = Math.sin(radians)*radius;
var ypos:Number = Math.cos(radians)*radius;

var line:Shape = new Shape();
line.x = stage.stageWidth*0.5;
line.y = stage.stageHeight*0.5;
addChild(line);

var g:Graphics = line.graphics;
g.clear();
g.lineStyle(2, 0x000000);
g.lineTo(xpos, ypos);

If you need to convert degrees to radians or radians to degrees you can use:

degrees to radians: (degrees * Math.PI) / 180
radians to degrees: (radians * 180) / Math.PI
heavilyinvolved
will that draw a line from the center of the chart
dpaksp
It will draw a 400px long line from the center of the stage to (xpos, ypos) which is determined by radians.
heavilyinvolved