diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..58702a2e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +// .gitignore file +code/secret.js \ No newline at end of file diff --git a/README.md b/README.md index 1613a3b0..28a8e7ba 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. +The assignment was to create a GitHub Tracker. ## 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? +Using HTML, CSS and JS. Using the API:s frm GitHub. Also first use of a chart. If I had more time I would've continued with the styling and JS functions. The styling as of now I think has too much code. ## 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://modest-archimedes-0644fa.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..c5522f29 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,37 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') +const ctx = document.getElementById("myChart").getContext("2d"); //"Draw" the chart here 👇 + +const drawChart = (amount) => { + const config = { + type: "bar", + data: { + labels: ["Finished projects", "Projects to do"], + datasets: [ + { + label: "Technigo Projects", + data: [amount, 19 - amount], + backgroundColor: ["#13233d", "#fafafa"], + + hoverOffset: 4, + }, + ], + }, + options: { + layout: { + padding: 25, + }, + plugins: { + legend: { + labels: { + font: { + size: 15, + }, + }, + }, + }, + }, + }; + const myChart = new Chart(ctx, config); +}; diff --git a/code/index.html b/code/index.html index 2fb5e0ae..fc40b5b2 100644 --- a/code/index.html +++ b/code/index.html @@ -6,16 +6,23 @@