From 5ac6494aa2f1c49d0ce9b1cda988c9a31ed85bfb Mon Sep 17 00:00:00 2001 From: Kyparn <93533136+Kyparn@users.noreply.github.com> Date: Fri, 25 Feb 2022 11:46:41 +0100 Subject: [PATCH 01/13] update --- code/chart.js | 36 ++++++++++++++++++ code/index.html | 57 ++++++++++++++++++---------- code/script.js | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ code/style.css | 83 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 254 insertions(+), 21 deletions(-) diff --git a/code/chart.js b/code/chart.js index 92e85a30..4b0decb4 100644 --- a/code/chart.js +++ b/code/chart.js @@ -2,3 +2,39 @@ const ctx = document.getElementById('chart').getContext('2d') //"Draw" the chart here 👇 +const myChart = new Chart(ctx, { + type: 'line', + data: { + labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], + datasets: [ + { + label: '# of Votes', + data: [12, 19, 3, 5, 2, 3], + backgroundColor: [ + 'rgba(255, 99, 132, 0.2)', + 'rgba(54, 162, 235, 0.2)', + 'rgba(255, 206, 86, 0.2)', + 'rgba(75, 192, 192, 0.2)', + 'rgba(153, 102, 255, 0.2)', + 'rgba(255, 159, 64, 0.2)', + ], + borderColor: [ + 'rgba(255, 99, 132, 1)', + 'rgba(54, 162, 235, 1)', + 'rgba(255, 206, 86, 1)', + 'rgba(75, 192, 192, 1)', + 'rgba(153, 102, 255, 1)', + 'rgba(255, 159, 64, 1)', + ], + borderWidth: 1, + }, + ], + }, + options: { + scales: { + y: { + beginAtZero: true, + }, + }, + }, +}) diff --git a/code/index.html b/code/index.html index 2fb5e0ae..2bdaeccd 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,40 @@ -
- - - -
+