From 563b7d72d37d1fc0d008e5e5e39fcbed4c04b93e Mon Sep 17 00:00:00 2001 From: HW Computer Date: Wed, 19 Apr 2023 21:51:58 -0500 Subject: [PATCH] BAR CHART WIP --- index.html | 7 +++++-- main.js | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 2de4963..a7ffc5a 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,9 @@ + @@ -53,8 +56,8 @@

-
- +
+
diff --git a/main.js b/main.js index 5036d70..640e4e6 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,12 @@ const submitButton = document.getElementById('subBut'); submitButton.addEventListener("click", parseName); +var barChart = document.querySelector('#grades'); +if(barChart.getAttribute('value') == 'invisible'){ + barChart.style.display = 'none'; +} +/* + Parse the name +*/ function parseName() { let className = ''; let classNum = ''; @@ -16,7 +23,6 @@ function parseName() { return; } if(className == '' || department == '') { - return; } console.log(department, 0, className); @@ -71,4 +77,11 @@ async function PapaParse(department, num, name) { // console.log(selectedClass[i]["Count of letter grade"]); } console.log(gradeDist); -} \ No newline at end of file + barChart.style.display = ''; +} + +const myChart = new Chart("myChart", { + type: "bar", + data: {}, + options: {} + }); \ No newline at end of file