Files
homework4/main.js
Andrea Bianchi a9b2b8b4bf Init
2026-03-28 11:13:57 +09:00

41 lines
782 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 - code snippet to get you started and that you can modify
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,
},
},
},
});