<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Line Chart</title>
		<script src="../src/Chart.Core.js"></script>
		<script src="../src/Chart.Line.js"></script>
	</head>
	<body>
		<div style="width:50%">
			<div>
				<canvas id="canvas" height="450" width="600"></canvas>
			</div>
		</div>
		<div id="legend-line" style="padding:8px; border: 1px solid #ECECEC;"></div>

	<script>
		var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
		var lineChartData = {
			labels : ["January","February","March","April","May","June","July"],
			datasets : [
				{
					label: "My First dataset",
					fillColor : "rgba(220,220,220,0.2)",
					strokeColor : "rgba(220,220,220,1)",
					pointColor : "rgba(220,220,220,1)",
					pointStrokeColor : "#fff",
					pointHighlightFill : "#fff",
					pointHighlightStroke : "rgba(220,220,220,1)",
					data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
				},
				{
					label: "My Second dataset",
					fillColor : "rgba(151,187,205,0.2)",
					strokeColor : "rgba(151,187,205,1)",
					pointColor : "rgba(151,187,205,1)",
					pointStrokeColor : "#fff",
					pointHighlightFill : "#fff",
					pointHighlightStroke : "rgba(151,187,205,1)",
					data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
				}
			]

		}

	window.onload = function(){
		var ctx = document.getElementById("canvas").getContext("2d");
		window.myLine = new Chart(ctx).Line(lineChartData, {
			responsive: true,
			animationSteps: 20,
			multiTooltipTemplate: "<%= datasetLabel %> - <%= value %>",
			//datasetFill: false,
			//bezierCurve: false,
			pointDotRadius: 8,
			legendTemplate : "<% for (var i=0; i<datasets.length; i++){%><span style=\"padding:2px; background-color:<%=datasets[i].strokeColor%>\">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;<%if(datasets[i].label){%><%=datasets[i].label%><%}%> &nbsp; &nbsp; &nbsp; <%}%>"
		});
		document.getElementById('legend-line').innerHTML = window.myLine.generateLegend();
	}


	</script>
	</body>
</html>
