Skip to content

Commit 6e8084f

Browse files
committed
Fixed the width of the chart, a centering & padding issue, removed console.logs and made the chart a bit less static.
1 parent b610db3 commit 6e8084f

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

code/chart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
const ctx = document.getElementById('chart').getContext('2d')
2-
const technigoProjects = 20
2+
const technigoProjects = 21
33

44
const drawBarChart = (repos) => {
55
new Chart(ctx, {
66
type: 'doughnut',
77
data: {
88
labels: [
9-
'Technigo projects',
9+
'Projects to do',
1010
'Finished projects'
1111
],
1212
datasets: [
1313
{
1414
data: [
15-
technigoProjects,
16-
repos.length
15+
repos,
16+
technigoProjects - repos
1717
],
1818
backgroundColor: [
1919
'#d5a7b6',

code/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<meta charset="UTF-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<title>Ziko's GitHub Tracker</title>
98
<link rel="stylesheet" href="./style.css" />
109
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10+
<title>Project Four: Ziko's GitHub Tracker</title>
11+
<meta name="desciption" content="Technigo Week 7: GitHub Tracker. Fourth individual project: Dig deeper into API's and start with unit testing.">
1112
</head>
1213

1314
<body>
@@ -20,7 +21,7 @@ <h1>Ziko's GitHub Tracker</h1>
2021

2122
<section id="profile-wrapper"></section>
2223

23-
<h2>Projects:</h2>
24+
<h2>"Project" repos:</h2>
2425
<section id="projects"></section>
2526

2627
<section id="chart-wrapper">

code/script.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const fetchProfile = () => {
1010
fetch(USER_URL)
1111
.then((response) => response.json())
1212
.then((data) => {
13-
console.log('fetchProfile', data)
1413
profileContainer.innerHTML += `
1514
<div id="profile">
1615
<figure class="profile-image">
@@ -30,7 +29,6 @@ const fetchRepos = () => {
3029
fetch(USER_REPOS_URL)
3130
.then((response) => response.json())
3231
.then((data) => {
33-
console.log('fetchRepos', data)
3432
const technigoRepos = data.filter(
3533
(repo) => repo.name.includes('project-') && repo.fork
3634
)

code/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ h3 {
6767
padding: 1rem;
6868
}
6969

70+
#chart-wrapper {
71+
width: 90vw;
72+
max-width: 512px;
73+
margin: 0 auto;
74+
}
75+
7076
header {
7177
position: sticky;
7278
top: 0;
@@ -79,7 +85,7 @@ footer {
7985
header, footer {
8086
background-color: #f2f2f2;
8187
text-align: center;
82-
padding: 1rem;
88+
padding: 1rem 0rem;
8389
width: 100%;
8490
}
8591

0 commit comments

Comments
 (0)