Advertisement
AkashSaikia

Line chart

Mar 28th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.13 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4.   <script type="text/javascript">
  5.   window.onload = function () {
  6.     var chart = new CanvasJS.Chart("chartContainer",
  7.     {
  8.       title:{
  9.       text: "Earthquakes - per month"
  10.       },
  11.        data: [
  12.       {
  13.         markerSize: 25,
  14.         type: "line",
  15.  
  16.         dataPoints: [
  17.         { x: new Date(2012, 00, 1), y: 450 },
  18.         { x: new Date(2012, 01, 1), y: 414 },
  19.         { x: new Date(2012, 02, 1), y: 520 },
  20.         { x: new Date(2012, 03, 1), y: 460 },
  21.         { x: new Date(2012, 04, 1), y: 450 },
  22.         { x: new Date(2012, 05, 1), y: 500 },
  23.         { x: new Date(2012, 06, 1), y: 480 },
  24.         { x: new Date(2012, 07, 1), y: 480 },
  25.         { x: new Date(2012, 08, 1), y: 410 },
  26.         { x: new Date(2012, 09, 1), y: 500 },
  27.         { x: new Date(2012, 10, 1), y: 480 },
  28.         { x: new Date(2012, 11, 1), y: 510 }
  29.         ]
  30.       }
  31.       ]
  32.     });
  33.  
  34.     chart.render();
  35.   }
  36.   </script>
  37.  <script type="text/javascript" src="/assets/script/canvasjs.min.js"></script></head>
  38. <body>
  39.   <div id="chartContainer" style="height: 300px; width: 100%;">
  40.   </div>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement