Skip to content

XYChart remove inner padding between the chart and the axis #1700

Answered by williaster
matecsigi asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @matecsigi thanks for checkout out visx. This spacing comes from the band type scale which you are using for the x-axis. this is often used for bar charts where each point has a width – and in this case the line point is in the middle of the band (the d3-scale docs have a good visual explanation of this)

Here's an update with a time scale which corrects the problem https://codesandbox.io/s/fancy-mountain-d7u9v4?file=/src/App.tsx

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matecsigi
Comment options

Answer selected by matecsigi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants