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
33 lines (26 loc) 路 648 Bytes
/
Copy pathchart.js
File metadata and controls
33 lines (26 loc) 路 648 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
//DOM-selector for the canvas 馃憞
const ctx = document.getElementById('chart').getContext('2d')
//'Draw' the chart here 馃憞
console.log('Pie chart is here')
const drawChart = (x) => {
const data = {
labels: [
'Done!',
'Not done, yet!',
],
datasets: [{
label: 'My First Dataset',
data: [x, 19-x],
backgroundColor: [
'#7B6079',
'#DE8971',
],
hoverOffset: 4
}]
};
const config = {
type: 'doughnut',
data: data,
};
let myChart = new Chart(ctx,config);
}