diff options
author | Minteck <contact@minteck.org> | 2022-07-09 15:22:44 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-07-09 15:22:44 +0200 |
commit | 5abe8cba55965f70e07e1163239bcc9d797c864a (patch) | |
tree | eb29933d2d5420c134f21a941cceb1d361c53b1d /assets/graph.js | |
parent | 1a3ff5e4f8bbd4cf35093cdb42d0d93ca635c91e (diff) | |
download | bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.gz bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.bz2 bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.zip |
Bye bye desktop app
Diffstat (limited to 'assets/graph.js')
-rw-r--r-- | assets/graph.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/assets/graph.js b/assets/graph.js new file mode 100644 index 0000000..908c2e9 --- /dev/null +++ b/assets/graph.js @@ -0,0 +1,39 @@ +const ctx = document.getElementById('graph-display').getContext('2d'); +const graph = new Chart(ctx, { + type: 'line', + data: { + labels: [], + datasets: [{ + label: 'Balance', + data: [], + borderColor: 'rgba(153, 102, 255, 1)', + fill: false, + }, + { + label: 'Trendline', + data: [], + borderColor: 'rgba(153, 102, 255, .5)', + borderDash: [5], + pointRadius: 0, + fill: false, + }] + }, + options: { + scales: { + y: { + beginAtZero: true + } + }, + scaleLabel: "<%=value%>%", + legend: { + display: false + }, + tooltips: { + callbacks: { + label: function(tooltipItem, data) { + return data.labels[tooltipItem.index] + ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index] + '€'; + } + } + } + } +});
\ No newline at end of file |