comments
This commit is contained in:
@@ -128,6 +128,9 @@ async function PapaParse(department, num, name, sem) {
|
|||||||
(gradeChart ? updateChart(lableName, gradeDist) : createChart(gradeDist, lableName));
|
(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) {
|
function updateChart(labelName, gradeDist) {
|
||||||
gradeChart.config.data = {
|
gradeChart.config.data = {
|
||||||
labels: gradeLabels,
|
labels: gradeLabels,
|
||||||
@@ -141,6 +144,10 @@ function updateChart(labelName, gradeDist) {
|
|||||||
gradeChart.update();
|
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) {
|
function createChart(gradeDist, courseName) {
|
||||||
gradeChart = new Chart(ctx, {
|
gradeChart = new Chart(ctx, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
|
|||||||
Reference in New Issue
Block a user