From b51afcbdcfbace651e920702490403d3066c504c Mon Sep 17 00:00:00 2001 From: Anush Gupta <74965306+Anush2303@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:51:55 +0000 Subject: [PATCH 1/3] legend high contrast fix --- .../horizontal-bar-chart.styles.ts | 22 +++++++++++++++---- .../horizontal-bar-chart.template.ts | 8 ++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts index 31d834d8defe2..e3f1f8fbdf640 100644 --- a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts +++ b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts @@ -5,6 +5,7 @@ import { colorNeutralForeground1, colorNeutralStrokeAccessible, display, + forcedColorsStylesheetBehavior, shadow4, spacingHorizontalL, spacingHorizontalS, @@ -50,17 +51,17 @@ export const styles: ElementStyles = css` border: 2px; pointer-events: none; } - .tooltipline { + .tooltip-line { padding-inline-start: 8px; height: 50px; border-inline-start: 4px solid; } - .tooltiplegend { + .tooltip-legend-text { font-size: 13px; color: theme.semanticColors.bodyText; text-align: start; } - .tooltipdata { + .tooltip-data-y { font-weight: bold; font-size: 30px; text-align: start; @@ -164,4 +165,17 @@ export const styles: ElementStyles = css` ${typographyBody1StrongStyles} color: ${colorNeutralForeground1}; } -`; +`.withBehaviors( + forcedColorsStylesheetBehavior(css` + .legend-rect, + .tooltip-line { + forced-color-adjust: none; + } + + .tooltip-legend-text, + .tooltip-content-y { + forced-color-adjust: auto; + color: rgb(255, 255, 255); + } + `), +); diff --git a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.template.ts b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.template.ts index cb3da5a440eef..a4ad44d927c4e 100644 --- a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.template.ts +++ b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.template.ts @@ -47,9 +47,11 @@ export function horizontalbarchartTemplate(): Elem class="tooltip" style="inset-inline-start: ${x => x.tooltipProps.xPos}px; top: ${x => x.tooltipProps.yPos}px" > -
-
${x => x.tooltipProps.legend}
-
${x => x.tooltipProps.yValue}
+
+
${x => x.tooltipProps.legend}
+
+ ${x => x.tooltipProps.yValue} +
`, From ba3f748b5ba252b93ff789644395c1fc6d641793 Mon Sep 17 00:00:00 2001 From: Anush Gupta <74965306+Anush2303@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:09:45 +0000 Subject: [PATCH 2/3] benchmark triangle fix --- .../src/horizontal-bar-chart/horizontal-bar-chart.styles.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts index e3f1f8fbdf640..87e0ad6130754 100644 --- a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts +++ b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts @@ -168,7 +168,8 @@ export const styles: ElementStyles = css` `.withBehaviors( forcedColorsStylesheetBehavior(css` .legend-rect, - .tooltip-line { + .tooltip-line, + .triangle { forced-color-adjust: none; } From 0eb83be67ab6a46b1a0e0c339519eedb46d01eeb Mon Sep 17 00:00:00 2001 From: Anush Gupta <74965306+Anush2303@users.noreply.github.com> Date: Thu, 21 Nov 2024 05:56:51 +0000 Subject: [PATCH 3/3] bar labels not visible fix --- .../src/horizontal-bar-chart/horizontal-bar-chart.styles.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts index 87e0ad6130754..87cc4b060ff2f 100644 --- a/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts +++ b/packages/charts/chart-web-components/src/horizontal-bar-chart/horizontal-bar-chart.styles.ts @@ -165,6 +165,11 @@ export const styles: ElementStyles = css` ${typographyBody1StrongStyles} color: ${colorNeutralForeground1}; } + @media (forced-colors: active) { + .bar-label { + fill: white !important; + } + } `.withBehaviors( forcedColorsStylesheetBehavior(css` .legend-rect,