chart.js
//in terminal:
yarn add chart.js // or npm install chart.js if you use npm
//html file:
<canvas id="my-chart" width="400" height="400"></canvas>
//js file
import Chart from 'chart.js'
const ctx = document.getElementById('my-chart').getContext('2d');
const chart = new Chart(ctx, {
// The type of chart we want to create
type: 'bar',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
// Configuration options go here
options: {}
});
};