forked from Technigo/project-github-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart.js
More file actions
49 lines (47 loc) · 991 Bytes
/
Copy pathchart.js
File metadata and controls
49 lines (47 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const renderChart = ((completedProjects) => {
const data = {
labels: [''],
datasets: [{
data: [completedProjects],
label: 'completed',
backgroundColor: 'rgb(63, 103, 126)',
}, {
data: [19-completedProjects],
label: 'remaining',
backgroundColor: 'rgb(63, 203, 226, 0.1)',
}]
};
const config = {
type: 'bar',
data: data,
options: {
indexAxis: 'y',
scales: {
x: {
stacked: true,
grid: {
display: true,
},
},
y: {
stacked: true,
grid: {
display: true,
}
}
},
plugins: {
title: {
display: true,
text: `Technigo projects completed: ${completedProjects} of 19`,
position: 'top',
},
legend: {
display: false,
position: 'top',
}
}
}
};
new Chart(document.getElementById('chart'), config);
});