07-29
Open
subtask #39 맨처음 차트(전국 연도별 차트) star
07-29 Open
Tasks
<div>
  <canvas id="total_accident" width="400" height="400">
</div>
<!-- <script src="{{ url_for('static', filename='js/total_accident_rate_copy.js') }}"></script> -->
<script>
  var ctx10 = document.getElementById("total_accident");
  var data = {
      labels: ['2005','2006','2007','2008','2009','2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'],
      datasets: [{
          label: '사고 건수',
          data: [26460, 29990, 28416, 26873, 28207, 28641, 28461, 29093, 26589, 24043, 24399, 19769, 19517, 19381, 15708]
      }]
  };
  var month_barChart = new Chart(ctx10, {
      type: 'bar',
      data: data,
      options: {
              title: {
                  display: true,
                  text: '2005년 ~ 2019년 음주운전 교통사고 발생건수',
                  position : 'top',
                  fontSize : 25
              },
              scales: {
                  yAxes: [{
                      ticks: {
                           beginAtZero: true
                      }
                  }]
              }
          }
  });
</script>
</canvas>
Issue Sharer
Comment 0

Add a comment
New subtask
Assignee
No assignee
Milestone
No milestone
Due date
No due date
Comment 0