diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8a3064b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +code/token.js diff --git a/.vscode/settings.json b/.vscode/settings.json index e8783bfe..ca5de4ce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { "liveServer.settings.port": 5505 -} \ No newline at end of file +} diff --git a/README.md b/README.md index 1613a3b0..66f697ed 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@ # 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. +The week 7 project was creating a github tracker to keep track of the GitHub repos using GitHub API. The pie chart shows the number of projects that I have done at technigo and number of projects left to be done using Chart.js. ## 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? +This project was roller-coaster ride and I could learn a lot about how to fetch from Api and invoking the functions. I solved my problems by googling, stack overflow and town-hall sessions. If I had more time, I would like to add some more data to display and added bit more styling. ## 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. +Check it out here https://sherin-github-tracker.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..b0d0ea32 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,27 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') +const ctx = document.getElementById("chart").getContext("2d"); //"Draw" the chart here 👇 +const fetchChart = (amount) => { + const labels = ["Completed Projects", "Remaining Projects"]; + + const data = { + labels: labels, + datasets: [ + { + label: "Technigo projects", + backgroundColor: ["rgb(57, 91, 100)", "rgb(148, 180, 159)"], + borderColor: "#f7e9e7", + data: [amount, 19 - amount], + hoverOffset: 4, + }, + ], + }; + + const config = { + type: "pie", + data: data, + }; + + const myChart = new Chart(ctx, config); +}; diff --git a/code/image/github.png b/code/image/github.png new file mode 100644 index 00000000..5eb5bc2d Binary files /dev/null and b/code/image/github.png differ diff --git a/code/index.html b/code/index.html index 2fb5e0ae..dc055844 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,26 @@ -
- - - -