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
47 lines (37 loc) 路 748 Bytes
/
Copy pathchart.js
File metadata and controls
47 lines (37 loc) 路 748 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
//DOM-selector for the canvas 馃憞
const ctx = document.getElementById('chart').getContext('2d')
//"Draw" the chart here 馃憞
const drawChart = (amount) => {
const config = {
type: 'doughnut',
data: {
labels: [
'Finished projects',
'Upcoming projects',
],
datasets: [{
label: 'My projects at Technigo',
data: [amount, 19-amount],
backgroundColor: [
'#f6e271',
'#f6B915',
],
hoverOffset: 4
}]
},
// Changeing the fontsize
options: {
plugins: {
legend: {
position: "bottom",
labels: {
font: {
size: 20,
},
},
},
},
},
};
const projectsChart = new Chart(ctx, config);
}