mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-10 15:53:03 +03:00
32 lines
549 B
JavaScript
32 lines
549 B
JavaScript
function initChart() {
|
|
const ctx = document.getElementById("myChart");
|
|
|
|
new Chart(ctx, {
|
|
type: "bar",
|
|
data: {
|
|
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
|
|
datasets: [
|
|
{
|
|
label: "# of Votes",
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
borderWidth: 1,
|
|
},
|
|
],
|
|
},
|
|
options: {
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
document.addEventListener(
|
|
"DOMContentLoaded",
|
|
function () {
|
|
initChart();
|
|
},
|
|
false
|
|
);
|