diff --git a/README.md b/README.md index 1613a3b0..96c65513 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. +They assignment was to make a Github tracker with information fetched from githubs apis. ## 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? +Initially I didnt split up the fetch and the actual rendering of the content on my site. After doing a couple of functions I realised that it would probably be a better solution to split the fetching of the data and the rendering up into different functions. ## 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://zancotti-githubtracker.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..e2a2f133 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,22 @@ -//DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') +const renderChart = (finishedProjects) => { + //DOM-selector + const ctx = document.getElementById("chart").getContext("2d"); -//"Draw" the chart here 👇 + //Chart + const config = { + type: "pie", + data: { + labels: ["Finished projects", "Projects left"], + datasets: [ + { + label: "My First Dataset", + data: [finishedProjects, 19 - finishedProjects], + backgroundColor: ["rgb(0,250,154,0.20)", "rgb(228, 228, 228)"], + hoverOffset: 4, + }, + ], + }, + }; + + const myChart = new Chart(ctx, config); +}; diff --git a/code/index.html b/code/index.html index 2fb5e0ae..9da7519f 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,47 @@ -
- - - -