From c7ae78c02fc2ae11201404433bcd050d6acaa387 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Mon, 10 Nov 2025 09:53:18 +0200 Subject: [PATCH] Fix chart label outline color (#27882) --- src/components/chart/ha-chart-base.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 01cec98dcb..1097dc6dbe 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -627,6 +627,10 @@ export class HaChartBase extends LitElement { } private _createTheme(style: CSSStyleDeclaration) { + const textBorderColor = + style.getPropertyValue("--ha-card-background") || + style.getPropertyValue("--card-background-color"); + const textBorderWidth = 2; return { color: getAllGraphColors(style), backgroundColor: "transparent", @@ -650,22 +654,22 @@ export class HaChartBase extends LitElement { graph: { label: { color: style.getPropertyValue("--primary-text-color"), - textBorderColor: style.getPropertyValue("--primary-background-color"), - textBorderWidth: 2, + textBorderColor, + textBorderWidth, }, }, pie: { label: { color: style.getPropertyValue("--primary-text-color"), - textBorderColor: style.getPropertyValue("--primary-background-color"), - textBorderWidth: 2, + textBorderColor, + textBorderWidth, }, }, sankey: { label: { color: style.getPropertyValue("--primary-text-color"), - textBorderColor: style.getPropertyValue("--primary-background-color"), - textBorderWidth: 2, + textBorderColor, + textBorderWidth, }, }, categoryAxis: {