diff options
author | JJ <nicetry@noemail.com> | 2025-03-21 13:45:32 +0000 |
---|---|---|
committer | JJ <nicetry@noemail.com> | 2025-03-21 13:45:32 +0000 |
commit | b679c6c2e28621ca6810bcdd14ef7a5db0236a6b (patch) | |
tree | 8ca164f4804ee1e8fb1ea106f4c1a45e5f094d7e /static/chess-charts.js | |
parent | fa8ad82036fc8964f19dd38a9a2ef5acb1970f17 (diff) |
Diffstat (limited to 'static/chess-charts.js')
-rw-r--r-- | static/chess-charts.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/static/chess-charts.js b/static/chess-charts.js new file mode 100644 index 0000000..2932b2a --- /dev/null +++ b/static/chess-charts.js @@ -0,0 +1,46 @@ +const chessData = JSON.parse(document.getElementById("chessData").textContent); +const bulletData = chessData[0]; +const blitzData = chessData[1]; +const rapidData = chessData[2]; + +const rapidCtx = document.getElementById("rapidChart").getContext("2d"); +const rapidChart = new Chart(rapidCtx, { + type: "line", + data: { + datasets: [ + { + borderColor: "#3273dc", + label: "rapid", + data: rapidData.data, + }, + ], + }, +}); + +const blitzCtx = document.getElementById("blitzChart").getContext("2d"); +const blitzChart = new Chart(blitzCtx, { + type: "line", + data: { + datasets: [ + { + borderColor: "#EDAE49", + label: "blitz", + data: blitzData.data, + }, + ], + }, +}); + +const bulletCtx = document.getElementById("bulletChart").getContext("2d"); +const bulletChart = new Chart(bulletCtx, { + type: "line", + data: { + datasets: [ + { + borderColor: "#D1495B", + label: "bullet", + data: bulletData.data, + }, + ], + }, +}); |