fix: better previous on overview

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-16 14:34:32 +02:00
parent 56ad8854eb
commit 1187bcac0a
2 changed files with 14 additions and 12 deletions

View File

@@ -36,6 +36,15 @@ export const BarWithBorder = (options: Options) => {
}; };
}; };
export const BarShapeGrey = BarWithBorder({
borderHeight: 2,
border: 'rgba(100, 100, 100, 1)',
fill: 'rgba(100, 100, 100, 0.3)',
active: {
border: 'rgba(100, 100, 100, 1)',
fill: 'rgba(100, 100, 100, 0.4)',
},
});
export const BarShapeBlue = BarWithBorder({ export const BarShapeBlue = BarWithBorder({
borderHeight: 2, borderHeight: 2,
border: 'rgba(59, 121, 255, 1)', border: 'rgba(59, 121, 255, 1)',

View File

@@ -24,7 +24,7 @@ import {
YAxis, YAxis,
} from 'recharts'; } from 'recharts';
import { createChartTooltip } from '../charts/chart-tooltip'; import { createChartTooltip } from '../charts/chart-tooltip';
import { BarShapeBlue } from '../charts/common-bar'; import { BarShapeBlue, BarShapeGrey } from '../charts/common-bar';
import { useXAxisProps, useYAxisProps } from '../report-chart/common/axis'; import { useXAxisProps, useYAxisProps } from '../report-chart/common/axis';
import { PreviousDiffIndicatorPure } from '../report-chart/common/previous-diff-indicator'; import { PreviousDiffIndicatorPure } from '../report-chart/common/previous-diff-indicator';
import { Skeleton } from '../skeleton'; import { Skeleton } from '../skeleton';
@@ -245,20 +245,13 @@ function Chart({
className="stroke-border" className="stroke-border"
/> />
<Line <Bar
key={`prev_${activeMetric.key}`} key={`prev_${activeMetric.key}`}
type="step"
dataKey={`prev_${activeMetric.key}`} dataKey={`prev_${activeMetric.key}`}
stroke={'var(--border)'}
strokeWidth={2}
isAnimationActive={false} isAnimationActive={false}
dot={false} shape={(props: any) => (
activeDot={{ <BarShapeGrey isActive={activeBar === props.index} {...props} />
stroke: 'var(--foreground)', )}
fill: 'var(--def-100)',
strokeWidth: 1,
r: 2,
}}
/> />
<Bar <Bar
key={activeMetric.key} key={activeMetric.key}