diff --git a/web/components/charts/contract/binary.tsx b/web/components/charts/contract/binary.tsx index 372577c4..6d906998 100644 --- a/web/components/charts/contract/binary.tsx +++ b/web/components/charts/contract/binary.tsx @@ -56,7 +56,7 @@ export const BinaryContractChart = (props: { const containerRef = useRef(null) const width = useElementWidth(containerRef) ?? 0 const height = props.height ?? (isMobile ? 250 : 350) - const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]) + const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]).clamp(true) const yScale = scaleLinear([0, 1], [height - MARGIN_Y, 0]) return (
diff --git a/web/components/charts/contract/choice.tsx b/web/components/charts/contract/choice.tsx index 5786b7bb..7cf3e5ed 100644 --- a/web/components/charts/contract/choice.tsx +++ b/web/components/charts/contract/choice.tsx @@ -159,7 +159,7 @@ export const ChoiceContractChart = (props: { const containerRef = useRef(null) const width = useElementWidth(containerRef) ?? 0 const height = props.height ?? (isMobile ? 150 : 250) - const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]) + const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]).clamp(true) const yScale = scaleLinear([0, 1], [height - MARGIN_Y, 0]) return (
diff --git a/web/components/charts/contract/pseudo-numeric.tsx b/web/components/charts/contract/pseudo-numeric.tsx index 987a7fea..0e2aaad0 100644 --- a/web/components/charts/contract/pseudo-numeric.tsx +++ b/web/components/charts/contract/pseudo-numeric.tsx @@ -71,7 +71,7 @@ export const PseudoNumericContractChart = (props: { const containerRef = useRef(null) const width = useElementWidth(containerRef) ?? 0 const height = props.height ?? (isMobile ? 150 : 250) - const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]) + const xScale = scaleTime(visibleRange, [0, width - MARGIN_X]).clamp(true) const yScale = contract.isLogScale ? scaleLog( [Math.max(contract.min, 1), contract.max],