simple chart js

Solutions on MaxInterview for simple chart js by the best coders in the world

showing results for - "simple chart js"
Charles
02 Nov 2016
1<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
2<div>
3  <canvas id="myChart"></canvas>
4</div>
5 
6<script>
7  const labels = [
8  'January',
9  'February',
10  'March',
11  'April',
12  'May',
13  'June',
14];
15const data = {
16  labels: labels,
17  datasets: [{
18    label: 'My First dataset',
19    backgroundColor: 'rgb(255, 99, 132)',
20    borderColor: 'rgb(255, 99, 132)',
21    data: [0, 10, 5, 2, 20, 30, 45],
22  }]
23};
24  
25  const config = {
26  type: 'line',
27  data: data,
28  options: {}
29};
30  
31  var myChart = new Chart(
32    document.getElementById('myChart'),
33    config
34  );
35</script>
similar questions
queries leading to this page
simple chart js