From 3435bdaaabec4091880201d57cf6de9a10317bdd Mon Sep 17 00:00:00 2001 From: Bram Barbieri Date: Sun, 31 Mar 2024 20:27:33 +0200 Subject: [PATCH] extra dummy question added. --- web/newWebsite/questions-dashboard.html | 4 +-- web/newWebsite/questions-main.js | 40 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/web/newWebsite/questions-dashboard.html b/web/newWebsite/questions-dashboard.html index fa2a045..f3cb2f2 100644 --- a/web/newWebsite/questions-dashboard.html +++ b/web/newWebsite/questions-dashboard.html @@ -83,8 +83,8 @@

Question 2

- +

Question 3

+ diff --git a/web/newWebsite/questions-main.js b/web/newWebsite/questions-main.js index 0b19d5b..581545d 100644 --- a/web/newWebsite/questions-main.js +++ b/web/newWebsite/questions-main.js @@ -41,6 +41,25 @@ const question2Data = { }] }; +const question3Data = { + labels: ['Option A', 'Option B', 'Option C'], + datasets: [{ + label: 'Responses', + data: [30, 30, 30], + backgroundColor: [ + 'rgba(255, 99, 132, 0.2)', + 'rgba(54, 162, 235, 0.2)', + 'rgba(255, 206, 86, 0.2)' + ], + borderColor: [ + 'rgba(255, 99, 132, 1)', + 'rgba(54, 162, 235, 1)', + 'rgba(255, 206, 86, 1)' + ], + borderWidth: 1 + }] +}; + // Chart configurations for each question const chartConfig1 = { type: 'pie', @@ -79,6 +98,25 @@ const chartConfig2 = { } } }; + +const chartConfig3 = { + type: 'pie', + data: question3Data, + options: { + responsive: true, + legend: { + position: 'top', + }, + title: { + display: true, + text: 'Question 3 Responses' + }, + animation: { + animateScale: true, + animateRotate: true + } + } +}; // const chartConfig3 = { // type: 'pie', // data: question3Data.questionData(), @@ -105,6 +143,8 @@ const myChart1 = new Chart(ctx1, chartConfig1); const ctx2 = document.getElementById('chart2').getContext('2d'); const myChart2 = new Chart(ctx2, chartConfig2); +const ctx3 = document.getElementById('chart3').getContext('2d'); +const myChart3 = new Chart(ctx3, chartConfig3); // const ctx3 = document.getElementById('chart3').getContext('2d'); // const myChart3 = new Chart(ctx3, chartConfig3);