From 86e9589ba840e1a83f2df49b148f3781e8d20316 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Tue, 1 Aug 2023 14:51:15 -0500 Subject: [PATCH] comments --- docs/main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/main.js b/docs/main.js index bdb5e8d..60669f5 100644 --- a/docs/main.js +++ b/docs/main.js @@ -128,6 +128,9 @@ async function PapaParse(department, num, name, sem) { (gradeChart ? updateChart(lableName, gradeDist) : createChart(gradeDist, lableName)); } +/** + * If the chart is in a state of existence, we update the data values + */ function updateChart(labelName, gradeDist) { gradeChart.config.data = { labels: gradeLabels, @@ -141,6 +144,10 @@ function updateChart(labelName, gradeDist) { gradeChart.update(); } +/** + * If the chart is nowhere to be found, we load a new chart, its attributes and the values + * Then, make the chart visible on screen + */ function createChart(gradeDist, courseName) { gradeChart = new Chart(ctx, { type: 'bar',