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
29 lines (24 loc) · 659 Bytes
/
chart.js
File metadata and controls
29 lines (24 loc) · 659 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
const showChart = (countRepos) => {
const ctx = document.getElementById("chart").getContext("2d");
const labels = [`Finished projects`, `Projects left`];
const data = {
labels: labels,
datasets: [
{
label: "My Technigo projects",
backgroundColor: ["#9E9FCF", "#484B76"],
borderColor: "rgb(66, 66, 66)",
data: [countRepos, 19 - countRepos],
},
],
};
Chart.defaults.font.family = "Source Serif Pro";
Chart.defaults.font.size = "20";
Chart.defaults.color = "#000000";
const config = {
type: "pie",
data: data,
options: {},
};
const myChart = new Chart(ctx, config);
};