From 7505e6d21203a6a8e80954380d7a84e607e8ba49 Mon Sep 17 00:00:00 2001 From: Osmell Caicedo Date: Sat, 13 Jul 2024 12:36:08 -0500 Subject: [PATCH] use per-dataset settings instead of default colors to prevent the responsive behaviour change the chart color --- .../js/components/stats-overview/stat/chart.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/widgets/resources/js/components/stats-overview/stat/chart.js b/packages/widgets/resources/js/components/stats-overview/stat/chart.js index af3579fdcd..711438e901 100644 --- a/packages/widgets/resources/js/components/stats-overview/stat/chart.js +++ b/packages/widgets/resources/js/components/stats-overview/stat/chart.js @@ -41,13 +41,6 @@ export default function statsOverviewStatChart({ }, initChart: function () { - Chart.defaults.backgroundColor = getComputedStyle( - this.$refs.backgroundColorElement, - ).color - - Chart.defaults.borderColor = getComputedStyle( - this.$refs.borderColorElement, - ).color return new Chart(this.$refs.canvas, { type: 'line', @@ -59,6 +52,12 @@ export default function statsOverviewStatChart({ borderWidth: 2, fill: 'start', tension: 0.5, + backgroundColor : getComputedStyle( + this.$refs.backgroundColorElement, + ).color, + borderColor : getComputedStyle( + this.$refs.borderColorElement, + ).color }, ], },