Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(studio): swap area chart fills for gradients (#42063)

kemal.earth434d8735f339
diff --git a/apps/studio/components/ui/Charts/ComposedChart.tsx b/apps/studio/components/ui/Charts/ComposedChart.tsx
index 708c5397f37..b61528ee5a6 100644
--- a/apps/studio/components/ui/Charts/ComposedChart.tsx
+++ b/apps/studio/components/ui/Charts/ComposedChart.tsx
@@ -442,6 +442,22 @@ export function ComposedChart({
key={xAxisKey}
/>
+ <defs>
+ {visibleAttributes.map((attribute) => (
+ <linearGradient
+ key={`gradient-${attribute.name}`}
+ id={`gradient-${attribute.name}`}
+ x1="0"
+ y1="0"
+ x2="0"
+ y2="1"
+ >
+ <stop offset="5%" stopColor={attribute.color} stopOpacity={0.15} />
+ <stop offset="95%" stopColor={isDarkMode ? '#131313' : '#FFFFFF'} stopOpacity={0} />
+ </linearGradient>
+ ))}
+ </defs>
+
{chartStyle === 'bar'
? visibleAttributes.map((attribute) => (
<Bar
@@ -461,10 +477,10 @@ export function ComposedChart({
: visibleAttributes.map((attribute, i) => (
<Area
key={attribute.name}
- type="step"
+ type="linear"
dataKey={attribute.name}
stackId="1"
- fill={attribute.fill}
+ fill={`url(#gradient-${attribute.name})`}
fillOpacity={1}
stroke={attribute.color}
radius={20}
@@ -480,7 +496,7 @@ export function ComposedChart({
{maxAttribute && _showMaxValue && (
<Line
key={maxAttribute.attribute}
- type="step"
+ type="linear"
dataKey={maxAttribute.attribute}
stroke={CHART_COLORS.REFERENCE_LINE}
strokeWidth={2}