Skip to content

Open source CapCut alternative.

TypeScript

fix(site): referral sources legend follows the survey order

David Le0b44438a4cc5
diff --git a/site/src/app/cut/app/su/analytics/page.tsx b/site/src/app/cut/app/su/analytics/page.tsx
index d5e2f712..56e4c753 100644
--- a/site/src/app/cut/app/su/analytics/page.tsx
+++ b/site/src/app/cut/app/su/analytics/page.tsx
@@ -548,7 +548,9 @@ export default function SuAnalyticsPage() {
stackId="sources"
/>
))}
- <ChartLegend content={<ChartLegendContent />} />
+ {/* Recharts 3 sorts legend items by name by default; null keeps
+ the series order, which is the survey's order. */}
+ <ChartLegend content={<ChartLegendContent />} itemSorter={null} />
</BarChart>
</ChartContainer>
</ChartCard>