totalcpi = [1.8, 1.4, 1.6, 1.9, 1.3, 1, 0.1, -0.9, -0.8, -0.9, -0.3, 0.1, 0.4, 1.2, 1.4, 1.1, 1.2, 2, 2.6, 3.4, 3.5, 3.4, 3.1, 2.2];
corecpi = [1.9, 1.7, 2.1, 2, 1.5, 1.5, 1.8, 1.5, 1.6, 1.8, 1.9, 2, 1.8, 2, 1.9, 1.9, 2.4, 2.4, 1.7, 1.7, 1.7, 1.5, 1.5, 1.5];
month = [24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1];

AXIS_SIZE = 20;
EXTRA_PIXELS = 25;

function drawplot() {
	
	plot_w = 400;
	plot_h = 275;
	
	//var graphcanvas = createGraphCanvas(500, 500);	
	var paper = Raphael(10, 10, plot_w + EXTRA_PIXELS, plot_h + EXTRA_PIXELS);
	//lp = drawLine(paper, graphcanvas, datax, datay);
	
	// Challenge: how to best make an axis... '
	// Right now, we set it up so that 
	axis = drawAxis(paper, plot_w, plot_h, month, totalcpi, " ", [0, 25], [-2, 4], 2, "black", [1,12,24], [-1,0,1,2,3], ["May 2008", "April 2009", "April 2010"], [-1,0,1,2,3]);
	line_totalcpi = drawLine(paper, plot_w, plot_h, month, totalcpi, " ", [0, 25], [-2, 4], 3, "orange");
	line_corecpi = drawLine(paper, plot_w, plot_h, month, corecpi, " ", [0, 25], [-2, 4], 3, "#009999");
	//points1 = drawPoints(paper, plot_w, plot_h, dx3, dy3, dz3, [-4, 10], [-5, 10], "white");
	
	animateMouseOverStroke(line_totalcpi, "orange", "red");
	animateMouseOverStroke(line_corecpi, "#009999", "red");
	
	animateMouseOverInfoText(paper, line_totalcpi, "Total CPI");
	animateMouseOverInfoText(paper, line_corecpi, "Core CPI");
	
	point_totalcpi = drawPoints(paper, plot_w, plot_h, month, totalcpi, [], [0,25], [-2, 4], "orange");
	point_corecpi = drawPoints(paper, plot_w, plot_h, month, corecpi, [], [0,25], [-2, 4], "#009999");
	
	animateMouseOverFill(point_totalcpi, "orange", "red");
	animateMouseOverStroke(point_totalcpi, "black", "red");
	
	animateMouseOverFill(point_corecpi, "#009999", "red");
	animateMouseOverStroke(point_corecpi, "black", "red");
	
	animateMouseOverPointData(paper, point_totalcpi, totalcpi, "Total CPI: ");
	animateMouseOverPointData(paper, point_corecpi, corecpi, "Core CPI: ");
	
}
