UNPKG

chartnew.js

Version:

Simple HTML5 Charts using the canvas element

50 lines (46 loc) 1.48 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 BarData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { fillColor : "rgba(129, 172, 123, 0.5)", strokeColor : "rgba(129, 172, 123, 1)", pointColor : "rgba(129, 172, 123, 1)", pointStrokeColor : "#fff", drawMathDeviation: "stddev", deviationStrokeColor: "#000", deviationWidth: 5, data : ["60","70","75","65",,"80","0"], title : "bar 1" }, { fillColor : "rgba(29, 72, 223, 0.5)", strokeColor : "rgba(29, 72, 223, 1)", pointColor : "rgba(29, 72, 223, 1)", pointStrokeColor : "#fff", drawMathLine: "mean", mathLineStrokeColor: "#f00", data : [10,20,30,40,50,60,70], title : "bar 2" } ] } var opts= {inGraphDataShow:true, inGraphDataTmpl: '<%=meanDif(2)%>', bezierCurve: false, savePng: false, legend: true }; window.onload = function() { var myBar = new Chart(document.getElementById("mycanvas").getContext("2d")).Bar(BarData,opts); } </script> </body> </html>