Skip to content

A local-first personal finance app

fix crossover report resizing bug (#6821)

Matt Fiddaman1eb68c8e19f5
diff --git a/packages/desktop-client/src/components/reports/graphs/CrossoverGraph.tsx b/packages/desktop-client/src/components/reports/graphs/CrossoverGraph.tsx
index e8247a1546..eae330cc84 100644
--- a/packages/desktop-client/src/components/reports/graphs/CrossoverGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/CrossoverGraph.tsx
@@ -9,7 +9,6 @@ import {
Line,
LineChart,
ReferenceLine,
- ResponsiveContainer,
Tooltip,
XAxis,
YAxis,
@@ -176,73 +175,66 @@ export function CrossoverGraph({
}}
>
{(width, height) => (
- <ResponsiveContainer>
- <div style={{ ...(!compact && { marginTop: '15px' }) }}>
- <LineChart
- width={width}
- height={height}
- data={graphData.data}
- margin={{
- top: 0,
- right: 0,
- left: compact ? 0 : 20,
- bottom: compact ? 0 : 10,
- }}
- >
- {!compact && <CartesianGrid strokeDasharray="3 3" />}
- <XAxis
- dataKey="x"
- hide={compact}
- tick={{ fill: theme.pageText }}
- tickLine={{ stroke: theme.pageText }}
- />
- <YAxis
- hide={compact}
- tickFormatter={tickFormatter}
- tick={{ fill: theme.pageText }}
- tickLine={{ stroke: theme.pageText }}
- />
- {showTooltip && (
- <Tooltip
- content={<CustomTooltip />}
- isAnimationActive={false}
- />
- )}
- {graphData.crossoverXLabel && (
- <ReferenceLine
- x={graphData.crossoverXLabel}
- stroke={theme.noticeText}
- strokeDasharray="4 4"
- />
- )}
- <Line
- type="monotone"
- dataKey="investmentIncome"
- dot={false}
- stroke={theme.reportsNumberPositive}
- strokeWidth={2}
- {...animationProps}
- />
- <Line
- type="monotone"
- dataKey="expenses"
- dot={false}
- stroke={theme.reportsNumberNegative}
- strokeWidth={2}
- {...animationProps}
- />
- <Line
- type="monotone"
- dataKey="adjustedExpenses"
- dot={false}
- stroke={theme.reportsNumberNegative}
- strokeWidth={2}
- strokeDasharray="5 5"
- {...animationProps}
- />
- </LineChart>
- </div>
- </ResponsiveContainer>
+ <LineChart
+ width={width}
+ height={height}
+ data={graphData.data}
+ margin={{
+ top: compact ? 0 : 15,
+ right: 0,
+ left: compact ? 0 : 20,
+ bottom: compact ? 0 : 10,
+ }}
+ >
+ {!compact && <CartesianGrid strokeDasharray="3 3" />}
+ <XAxis
+ dataKey="x"
+ hide={compact}
+ tick={{ fill: theme.pageText }}
+ tickLine={{ stroke: theme.pageText }}
+ />
+ <YAxis
+ hide={compact}
+ tickFormatter={tickFormatter}
+ tick={{ fill: theme.pageText }}
+ tickLine={{ stroke: theme.pageText }}
+ />
+ {showTooltip && (
+ <Tooltip content={<CustomTooltip />} isAnimationActive={false} />
+ )}
+ {graphData.crossoverXLabel && (
+ <ReferenceLine
+ x={graphData.crossoverXLabel}
+ stroke={theme.noticeText}
+ strokeDasharray="4 4"
+ />
+ )}
+ <Line
+ type="monotone"
+ dataKey="investmentIncome"
+ dot={false}
+ stroke={theme.reportsNumberPositive}
+ strokeWidth={2}
+ {...animationProps}
+ />
+ <Line
+ type="monotone"
+ dataKey="expenses"
+ dot={false}
+ stroke={theme.reportsNumberNegative}
+ strokeWidth={2}
+ {...animationProps}
+ />
+ <Line
+ type="monotone"
+ dataKey="adjustedExpenses"
+ dot={false}
+ stroke={theme.reportsNumberNegative}
+ strokeWidth={2}
+ strokeDasharray="5 5"
+ {...animationProps}
+ />
+ </LineChart>
)}
</Container>
);
diff --git a/upcoming-release-notes/6821.md b/upcoming-release-notes/6821.md
new file mode 100644
index 0000000000..242b0852c6
--- /dev/null
+++ b/upcoming-release-notes/6821.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [matt-fidd]
+---
+
+Fix crossover report resizing bug