From 908c9e9ccc8ab857dc5389f28da7a15f3ca167ea Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Wed, 5 Feb 2025 11:50:49 -0800 Subject: [PATCH] Enable consistent styling on chart items --- .../ChatHistory/Chartable/CustomTooltip.jsx | 6 +- .../ChatHistory/Chartable/index.jsx | 66 ++++++++++++------- frontend/src/index.css | 4 ++ 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Chartable/CustomTooltip.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Chartable/CustomTooltip.jsx index b2002e23f8c..222209055f7 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Chartable/CustomTooltip.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Chartable/CustomTooltip.jsx @@ -46,9 +46,9 @@ export default function Tooltip({ legendColor, ...props }) { {...props} content={({ active, payload, label }) => { return active && payload ? ( -
+
-

{label}

+

{label}

{payload.map(({ value, name }, idx) => ( @@ -58,7 +58,7 @@ export default function Tooltip({ legendColor, ...props }) { >

-

{title}

+
+

+ {title} +

-

{title}

+
+

+ {title} +

-

{title}

+
+

+ {title} +

-

{title}

+
+

+ {title} +

{showLegend && ( -

{title}

+
+

+ {title} +

{showLegend && (
-

{title}

+
+

+ {title} +

-

{title}

+
+

+ {title} +

{showLegend && (
-

{title}

+
+

+ {title} +

{showLegend && (
-

{title}

+
+

+ {title} +

{showLegend && (
-

{title}

+
+

+ {title} +

{showLegend && (
{ const categoryPayload = payload?.[0]; if (!categoryPayload) return null; return ( -
+
{loading ? ( ) : ( diff --git a/frontend/src/index.css b/frontend/src/index.css index 539b5866582..4a20843d503 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -836,6 +836,10 @@ does not extend the close button beyond the viewport. */ fill: #fff; } +[data-theme="light"] .recharts-text > * { + fill: #000; +} + .recharts-legend-wrapper { margin-bottom: 10px; }