[Chartjs]-Charts.js graph not displaying

1👍

Please Use this code

var canvas = document.getElementById('myChart');

var data = {
     labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
    datasets: [{
      label: 'apples',
      data: [12, 19, 3, 17, 6, 3, 7],
      backgroundColor: "rgba(153,255,51,0.4)"
    }, {
      label: 'oranges',
      data: [2, 29, 5, 5, 2, 3, 10],
      backgroundColor: "rgba(255,153,0,0.4)"
    }]
};
var option = {
	scales: {
  	yAxes:[{
    		stacked:true,
        gridLines: {
        	display:true,
          color:"rgba(255,99,132,0.2)"
        }
    }],
    xAxes:[{
    		gridLines: {
        	display:true
        }
    }]
  }
};

var myBarChart = Chart.Line(canvas,{
	data:data,
  options:option
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
 <div class="container">

  <h2>Chart Demo</h2>

  <div>
    <canvas id="myChart"  width="400" height="200"></canvas>
  </div>

  </div>

Leave a comment