//Graph Class Sample Implementation
//** Assumes an empty movieclip is in the library with an ID name of "graph"


var XAxisMax = 60;
var YAxisMax = 40;
var XIncrement = 3;
var YIncrement = 5;

//creates a 500x300 graph named "graph1" at position 25, 25
//the X-axis will go to 60 by increments of 3, and the Y-axis will go to 40 by increments of 5
attachMovie("graph", "graph1", getNextHighestDepth(), {_x:25, _y:25}).init(500, 300, XAxisMax, YAxisMax, XIncrement, YIncrement);

//Turn on the x-axis gridlines
graph1.xGridLines = true;


//Adds a new line named "Line1" to the graph with 0x0066cc as the color
graph1.addLine("Line1", "0x0066cc");

//adds various data points to Line1
graph1.addDataPoint("Line1", 6, 35);
graph1.addDataPoint("Line1", 18, 30);
graph1.addDataPoint("Line1", 27, 20);
graph1.addDataPoint("Line1", 42, 15);
graph1.addDataPoint("Line1", 51, 10);
graph1.addDataPoint("Line1", 54, 5);

//Adds a second line to the graph named "Line2" with 0xffff00 as the color
graph1.addLine("Line2", "0xffff00");

//adds various data points to Line2
graph1.addDataPoint("Line2", 6, 25);
graph1.addDataPoint("Line2", 18, 24);
graph1.addDataPoint("Line2", 27, 30);
graph1.addDataPoint("Line2", 42, 25);
graph1.addDataPoint("Line2", 51, 38);
graph1.addDataPoint("Line2", 54, 0);

//Animates, or morphs Line1 into Line2
graph1.animateLines("Line2", "Line1");