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
25 lines (24 loc) · 711 Bytes
/
chart.js
File metadata and controls
25 lines (24 loc) · 711 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
//DOM-selector for the canvas
const ctx = document.getElementById('chart').getContext('2d')
// Chart showing completed projects and how many there is left
const repoChart = (amount) => {
const config = {
type: 'bar',
data: {
labels: [
'Projects done',
'Projects left',
],
datasets: [{
label: 'Technigo projects',
data: [amount, 19-amount],
backgroundColor: [
'rgb(63, 185, 79)',
'#8B949E',
],
hoverOffset: 4
}]
},
};
const repositoryChart = new Chart(ctx, config);
}