37 lines
720 B
JavaScript
37 lines
720 B
JavaScript
import './css/style.css';
|
|
import Chart from 'chart.js/auto';
|
|
import data from './data.json';
|
|
|
|
// Let's start
|
|
console.log('%cYour data is here ⬇', 'background-color: green; color: white');
|
|
console.log(data); // => your data
|
|
// Your code here ...
|
|
|
|
|
|
|
|
|
|
|
|
// Chart.js
|
|
const ctx = document.getElementById('chartCanavs').getContext('2d');
|
|
const chart = new Chart(ctx, {
|
|
type: 'bar',
|
|
data: {
|
|
// ... YOUR DATA HERE!
|
|
// might start looking at here: https://www.chartjs.org/docs/next/
|
|
},
|
|
// Some preset options for your!
|
|
options: {
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
legend: {
|
|
display: false,
|
|
},
|
|
},
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true,
|
|
},
|
|
},
|
|
},
|
|
});
|