From 50c7cf59ef44b0de431868c495c869167e35b834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 8 Oct 2023 16:54:00 -0400 Subject: [PATCH] add back legend --- public/src/admin/dashboard.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/src/admin/dashboard.js b/public/src/admin/dashboard.js index 9c027154c1..9ec8db599a 100644 --- a/public/src/admin/dashboard.js +++ b/public/src/admin/dashboard.js @@ -9,6 +9,7 @@ import { ArcElement, Tooltip, Filler, + Legend, } from 'chart.js'; import * as Benchpress from 'benchpressjs'; @@ -26,7 +27,8 @@ Chart.register( PointElement, ArcElement, Tooltip, - Filler + Filler, + Legend ); const intervals = { @@ -287,6 +289,11 @@ function setupGraphs(callback) { beginAtZero: true, }, }, + plugins: { + legend: { + position: 'bottom', + }, + }, interaction: { intersect: false, mode: 'index', @@ -296,6 +303,11 @@ function setupGraphs(callback) { const doughnutOpts = { responsive: true, + plugins: { + legend: { + display: false, + }, + }, }; graphs.registered = new Chart(registeredCtx, { type: 'doughnut',