PDA

View Full Version : Curved Graph


mehmet
04-22-2005, 07:50 AM
Hi everybody (first post in here)

i have this values for x and y
x | 0 - 40 - 80 - 120 - 160 - 200 - 240 - 280 - 320

y | 60 - 80 - 120 - 50 - 100 - 70 - 160 - 100 - 80

to draw a graph for this values. i first use moveTo(0,0) and then use lineTo to draw each line, so a graph showing this value is created automatically.
but how can i draw a curved graph. if i can refer two reference point per dots , it would be possible but with curveTo i can only refer one reference point per dot. so is it possible to create my curved graph? thnx

snapple
04-22-2005, 08:14 AM
xStart = 0;
yStart = 0;
xLength = 237;
yLength = 142; //hardcoded end of graph

_root.createEmptyMovieClip("graph", 1);
with(_root.graph)
{
lineStyle(2, 12189696, 100);
beginFill(22189696, 100);
//drawing axis
moveTo(xStart + xLength, yStart);
lineTo(xStart, yStart);
lineTo(xStart, yStart + yLength);
curveTo((xStart + xLength),(yStart + yLength), xStart + xLength, yStart);
endFill();
}


Regards, snapple