diff --git a/code/.gitignore b/code/.gitignore new file mode 100644 index 00000000..6b858da6 --- /dev/null +++ b/code/.gitignore @@ -0,0 +1,27 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + + +# Ignore Mac system files +.DS_store + +# Ignore node_modules folder +node_modules + +# Ignore all text files +*.txt + +# Ignore files related to API keys +.env + +# misc +/.pnp +.pnp.js +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# other +token.js + + + diff --git a/code/chart.js b/code/chart.js index 92e85a30..25785589 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,31 @@ -//DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') - //"Draw" the chart here 👇 +const labels = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'Another month', + ]; + + const data = { + labels: labels, + datasets: [{ + label: 'My First dataset', + backgroundColor: ['rgb(255, 99, 132)', 'rgb(100, 5, 100)'], + borderColor: 'rgb(255, 99, 132)', + data: [0, 10, 5, 2, 20, 30, 45], + }] + }; + + const config = { + type: 'doughnut', + data: data, + options: {} + }; + + const myChart = new Chart( + document.getElementById('chart'), + config + ); \ No newline at end of file diff --git a/code/index.html b/code/index.html index 2fb5e0ae..3fccc4d3 100644 --- a/code/index.html +++ b/code/index.html @@ -6,6 +6,7 @@