Skip to content

Commit 763736d

Browse files
committed
Adjust chart padding calculation for better visibility
Reduced default padding to 5% of the range and updated minimum padding logic for stocks and portfolios to improve chart display and ensure minimum visibility.
1 parent f912108 commit 763736d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/PerformanceChart.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,13 @@ const PerformanceChart = React.memo(({ selectedStock: propSelectedStock, selecte
577577
}
578578

579579
// Calculate padding as a percentage of the range
580-
// Use 10% padding above and below the range for good visibility
581-
const padding = range * 0.1;
580+
// Use 5% padding above and below the range for good visibility
581+
const padding = range * 0.05;
582582

583583
// Set minimum padding to ensure visibility
584584
const minPadding = selectedStock
585-
? Math.max(0.01, range * 0.05) // For stocks, at least $0.01 or 5% of range
586-
: Math.max(10, range * 0.05); // For portfolio, at least $10 or 5% of range
585+
? Math.max(0.01, range * 0.1) // For stocks, at least $0.01 or 5% of range
586+
: Math.max(1, range * 0.1); // For portfolio, at least $5 or 5% of range
587587

588588
const actualPadding = Math.max(padding, minPadding);
589589

0 commit comments

Comments
 (0)