Basic HTML5 Chart Example - CanvasJS

Basic HTML5 Chart Example

by brunberg

HTML

<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer",
	{
        
      data: [
      {
        type: "line",
        dataPoints: [
            {x: new Date(2009, 10, 21),y: 5.689}, 
            {x: new Date(2009, 10, 19),y: 5.6932}, 
            {x: new Date(2009, 10, 9),y: 5.692}, 
            {x: new Date(2009, 10, 5),y: 5.6938}, 
            {x: new Date(2009, 10, 4),y: 5.6973}, 
            {x: new Date(2009, 10, 3),y: 5.6992}
        ]
      }
      ]
    });

 chart.render();