|
| 1 | +<template name="chartLayout"> |
| 2 | + <div class="layout master-layout "> |
| 3 | + {{> navbar}} |
| 4 | + |
| 5 | + <div class="sampleChart"> |
| 6 | + <canvas id="canvasChart"></canvas> |
| 7 | + </div> |
| 8 | + </div> |
| 9 | + <script> |
| 10 | + var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; |
| 11 | + var lineChartData = { |
| 12 | + labels : ["January","February","March","April","May","June","July"], |
| 13 | + datasets : [ |
| 14 | + { |
| 15 | + label: "My First dataset", |
| 16 | + fillColor : "rgba(220,220,220,0.2)", |
| 17 | + strokeColor : "rgba(220,220,220,1)", |
| 18 | + pointColor : "rgba(220,220,220,1)", |
| 19 | + pointStrokeColor : "#fff", |
| 20 | + pointHighlightFill : "#fff", |
| 21 | + pointHighlightStroke : "rgba(220,220,220,1)", |
| 22 | + data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] |
| 23 | + }, |
| 24 | + { |
| 25 | + label: "My Second dataset", |
| 26 | + fillColor : "rgba(151,187,205,0.2)", |
| 27 | + strokeColor : "rgba(151,187,205,1)", |
| 28 | + pointColor : "rgba(151,187,205,1)", |
| 29 | + pointStrokeColor : "#fff", |
| 30 | + pointHighlightFill : "#fff", |
| 31 | + pointHighlightStroke : "rgba(151,187,205,1)", |
| 32 | + data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] |
| 33 | + } |
| 34 | + ] |
| 35 | + } |
| 36 | + window.onload = function(){ |
| 37 | + var ctx = document.getElementById("canvasChart").getContext("2d"); |
| 38 | + window.myLine = new Chart(ctx).Line(lineChartData, { |
| 39 | + responsive: true |
| 40 | + }); |
| 41 | + } |
| 42 | + </script> |
| 43 | +</template> |
0 commit comments