Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

fix(shopping): draw the Shopping page's charts in the theme's ink, as Mentions' trend does (#1585)

Cihan5bbd16299f28
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/shopping/shopping_charts.tsx b/web/src/app/[locale]/(dashboard)/dashboard/shopping/shopping_charts.tsx
index d706e11f6..c4528e575 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/shopping/shopping_charts.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/shopping/shopping_charts.tsx
@@ -1,17 +1,24 @@
'use client';
import {
+ Area,
Bar,
BarChart,
CartesianGrid,
+ ComposedChart,
Legend,
Line,
- LineChart,
Tooltip,
XAxis,
YAxis,
} from 'recharts';
+// Ink, the theme's primary, as Mentions' trend draws it: black on light,
+// near-white on dark. A second series is grey and dashed, told apart by
+// lightness and line, not by hue.
+const INK = 'var(--primary)';
+const SECOND = 'var(--muted-foreground)';
+
const AXIS_TICK = {
fill: 'var(--muted-foreground)',
fontSize: 11,
@@ -49,7 +56,7 @@ export function PlatformCardRateChartView({ width, data }: PlatformCardRateChart
<Tooltip contentStyle={TOOLTIP_STYLE} cursor={{ fill: 'var(--muted)', opacity: 0.3 }} />
- <Bar dataKey="rate" name="Card rate" fill="var(--chart-2)" radius={[4, 4, 0, 0]} />
+ <Bar dataKey="rate" name="Card rate" fill={INK} radius={[4, 4, 0, 0]} />
</BarChart>
);
}
@@ -65,12 +72,19 @@ type ShoppingTrendChartViewProps = {
export function ShoppingTrendChartView({ width, data }: ShoppingTrendChartViewProps) {
return (
- <LineChart
+ <ComposedChart
width={width}
height={220}
data={data}
margin={{ top: 8, right: 8, bottom: 0, left: -8 }}
>
+ <defs>
+ <linearGradient id="shoppingTrendFill" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor={INK} stopOpacity={0.18} />
+ <stop offset="95%" stopColor={INK} stopOpacity={0} />
+ </linearGradient>
+ </defs>
+
<CartesianGrid stroke="var(--border)" strokeDasharray="3 3" vertical={false} />
<XAxis
@@ -92,23 +106,27 @@ export function ShoppingTrendChartView({ width, data }: ShoppingTrendChartViewPr
}}
/>
- <Line
+ <Area
type="monotone"
dataKey="ownCards"
name="Your cards"
- stroke="var(--chart-2)"
+ stroke={INK}
strokeWidth={2}
- dot={{ r: 2 }}
+ fill="url(#shoppingTrendFill)"
+ dot={false}
+ activeDot={{ r: 4 }}
/>
<Line
type="monotone"
dataKey="totalCards"
name="All cards"
- stroke="var(--chart-4)"
+ stroke={SECOND}
strokeWidth={2}
- dot={{ r: 2 }}
+ strokeDasharray="4 3"
+ dot={false}
+ activeDot={{ r: 4 }}
/>
- </LineChart>
+ </ComposedChart>
);
}