fix: add tooltip text color for dark theme in all charts

Added color and itemStyle to Recharts Tooltip so text is visible on dark backgrounds.
This commit is contained in:
Fringg
2026-03-18 17:59:12 +03:00
parent c5f621b399
commit d640cc1a04
6 changed files with 12 additions and 0 deletions

View File

@@ -57,8 +57,10 @@ export function DonutChart({
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: SALES_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: SALES_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
/>
</PieChart>
</ResponsiveContainer>

View File

@@ -114,8 +114,10 @@ export function DualAreaChart({
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: SALES_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: SALES_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
formatter={(value: number | undefined, name: string | undefined) => {
const displayValue = value ?? 0;
if (name === 'series1') return [displayValue, series1Label];

View File

@@ -128,8 +128,10 @@ export function MultiSeriesAreaChart({
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: SALES_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: SALES_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
formatter={(value: number | undefined, name: string | undefined) => [
valueFormatter ? valueFormatter(value ?? 0) : (value ?? 0),
name || valueLabel || '',

View File

@@ -96,8 +96,10 @@ export function SimpleAreaChart({
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: SALES_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: SALES_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
formatter={(value: number | undefined) => [value ?? 0, valueLabel || '']}
/>
<Area

View File

@@ -77,8 +77,10 @@ export function SimpleBarChart({
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: SALES_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: SALES_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
formatter={(value: number | undefined) => [
valueFormatter ? valueFormatter(value ?? 0) : (value ?? 0),
]}

View File

@@ -111,8 +111,10 @@ export function DailyChart({ data, chartId, title, earningsLabel, countLabel }:
border: `1px solid ${colors.tooltipBorder}`,
borderRadius: PARTNER_STATS.TOOLTIP.BORDER_RADIUS,
fontSize: PARTNER_STATS.TOOLTIP.FONT_SIZE,
color: colors.label,
}}
labelStyle={{ color: colors.label }}
itemStyle={{ color: colors.label }}
formatter={(value: number | undefined, name: string | undefined) => {
const displayValue = value ?? 0;
if (name === 'earnings_display') {