From 503038d2a2e58f43eba264956c9fe41dff96c224 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Sun, 2 Oct 2022 16:59:49 -0700 Subject: [PATCH] Fix a dumb bug on pseudo-numeric charts --- web/components/charts/contract/pseudo-numeric.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/components/charts/contract/pseudo-numeric.tsx b/web/components/charts/contract/pseudo-numeric.tsx index 9e06b368..e3edb11f 100644 --- a/web/components/charts/contract/pseudo-numeric.tsx +++ b/web/components/charts/contract/pseudo-numeric.tsx @@ -86,11 +86,11 @@ export const PseudoNumericContractChart = (props: { Date.now() ) const visibleRange = [start, rightmostDate] - const xScale = scaleTime(visibleRange, [0, width ?? 0 - MARGIN_X]) + const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]) // clamp log scale to make sure zeroes go to the bottom const yScale = isLogScale - ? scaleLog([Math.max(min, 1), max], [height ?? 0 - MARGIN_Y, 0]).clamp(true) - : scaleLinear([min, max], [height ?? 0 - MARGIN_Y, 0]) + ? scaleLog([Math.max(min, 1), max], [height - MARGIN_Y, 0]).clamp(true) + : scaleLinear([min, max], [height - MARGIN_Y, 0]) return (