From c0f0f8db738648fc6ff0da46dd36eafc33d74b7e Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 21 Oct 2024 05:35:22 +0200 Subject: [PATCH] [FIX] Make chart labels better readable for darker themes --- .../templates/services/mumble/mumble_connection_history.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html index 536e3d39..03fff3bf 100644 --- a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html +++ b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html @@ -147,6 +147,8 @@ }); // Initialize empty Pie chart + const elementBody = document.querySelector('body'); + const elementBodyCss = getComputedStyle(elementBody); const ctx = document.getElementById('pieChart').getContext('2d'); const pieChart = new Chart(ctx, { type: 'pie', @@ -180,6 +182,8 @@ } }); + Chart.defaults.color = elementBodyCss.color; + // AJAX call to dynamically update the chart $.ajax({ url: '{% url "mumble:release_pie_chart_data" %}', // Your Django view URL that returns chart data