Chart.js #4670

by Akihiko Kusanagi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.js"></script>
<canvas id="myChart1"></canvas>

JavaScript

var ctx1 = document.getElementById('myChart1').getContext('2d');
var chart1 = new Chart(ctx1, {
  type: 'bar',
  data: {
    labels: ['01-09', '02-09', '03-09', '04-09', '05-09', '06-09', '07-09', '08-09', '09-09', '10-09', '11-09', '12-09', '13-09', '14-09', '15-09', '16-09', '17-09', '18-09', '19-09'],
    datasets: [{
      data: [230, 230, 230, 760, 230, 590, 590, 230, 230, 230, 230, 230, 920, 230, 820, 230, 230, 650, 920]
    }]
  },
  options: {
    responsive:true,
    maintainAspectRatio: false,
    legend: {
      display: false
    },
    scales: {
      yAxes: [{
        // stacked: true,
        ticks: {
          beginAtZero: true
        }
      }],
      xAxes: [{
        // stacked: true,
        ticks: {
          beginAtZero: true
        }
      }]
    }
  }
});