diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9cfb998e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +code/secret.js +.DS_Store +package-lock.json +package.json \ No newline at end of file diff --git a/code/chart.js b/code/chart.js index 92e85a30..0a5071db 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,28 @@ -//DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') -//"Draw" the chart here 👇 +const labels = [ + 'Completed projects', 'Total projects' + ]; + + const data = { + labels: labels, + datasets: [{ + label: 'Projects', + backgroundColor: ['rgb(76, 81, 105)', 'rgb(13, 18, 46)'], + data: [5, 20], + }] + }; + + const config = { + type: 'doughnut', + data: data, + options: { + maintainAspectRatio: false, + } + + }; + + const myChart = new Chart( + document.getElementById('chart'), + config + ); + diff --git a/code/index.html b/code/index.html index 2fb5e0ae..e084fbfa 100644 --- a/code/index.html +++ b/code/index.html @@ -5,17 +5,29 @@