Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <title>Bar Chart</title>
- <script src="../Chart.js"></script>
- <script src="../legend.js"></script>
- <meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
- <style>
- canvas{
- }
- </style>
- </head>
- <body>
- <div>
- <canvas id="canvas" height="300" width="300"></canvas>
- <div id="lineLegend"></div>
- </div>
- <script>
- var barChartData = {
- labels : [#meses],
- datasets : [
- {
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- data : [#datos1],
- title: '#titulo1'
- },
- {
- fillColor : "rgba(151,187,205,0.5)",
- strokeColor : "rgba(151,187,205,1)",
- data : [#datos2],
- title: '#titulo2'
- },
- {
- fillColor : "rgba(255,0,0,0.5)",
- strokeColor : "rgba(250,0,0,1)",
- data : [#datos3],
- title: '#titulo3'
- }
- ]
- };
- var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Bar(barChartData);
- var ctx = document.getElementById("canvas").getContext("2d");
- legend(document.getElementById("lineLegend"), barChartData);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement