UNPKG

chartnew.js

Version:

Simple HTML5 Charts using the canvas element

47 lines (43 loc) 1.26 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="PSPad editor, www.pspad.com"> <title></title> <SCRIPT src='../mathFunctions.js'></script> <!--[if lte IE 8]><SCRIPT src='source/excanvas.js'></script><![endif]--><SCRIPT src='../ChartNew.js'></script> </head> <body> <canvas id="mycanvas" height="600" width="800"></canvas> <script> var LineData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { strokeColor : "rgba(220,220,220,1)", pointColor : "rgba(220,220,220,1)", pointStrokeColor : "#fff", data : [565,559,590,581,556,555,540], title : "First data" }, { strokeColor : "rgba(151,187,205,1)", pointColor : "rgba(151,187,205,1)", pointStrokeColor : "#fff", data : [528,548,540,519,596,527,580], title : "Second data" } ] } var opts = { legend : true, datasetFill: false, legendBlockSize: 20, legendColorIndicatorStrokeWidth: 7 } window.onload = function() { var myBar = new Chart(document.getElementById("mycanvas").getContext("2d")).Line(LineData,opts); } </script> </body> </html>