diff --git a/README.md b/README.md index 1613a3b0..9e13b3f4 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # GitHub Tracker -Replace this readme with your own information about your project. - -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +This week was quite a challenge because I was traveling. Got a lot of help from the recorded videos. So thank God for this week! ## The problem -Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? +to understand which and what data comes from where or what. Using console.log(data) explained alot. ## View it live -Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. +https://practical-fermi-1dc0a6.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..362088d5 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,24 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') +const ctx = document.getElementById("chart").getContext("2d"); -//"Draw" the chart here 👇 +const drawProgressChart = (repos) => { + const completedProjects = repos.length; + const totalProjects = 20; + + const labels = repos.map((repo) => repo.name); + const data = repos.map((repo) => repo.size); + + const chart = new Chart(ctx, { + type: "doughnut", + data: { + labels: ["Completed Projects", "Projects left to build"], + datasets: [ + { + data: [completedProjects, totalProjects - completedProjects], + backgroundColor: ["blue", "red"], + hoverOffset: 4, + }, + ], + }, + }); +}; diff --git a/code/index.html b/code/index.html index 2fb5e0ae..9aa9fdd4 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,31 @@ -
- - - -