Skip to content

setting yScale min value for XYchart #1242

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

You must be logged in to vote

Hey @davidhan527 👋 thanks for checking out visx. This question is pretty similar to the discussion in #1147, so maybe check that out.

Overall the x/y-scale config for @visx/xychart mirrors what's available in the @visx/scale package so the scale docs might be useful. By default linear type scales in XYChart will automatically set the min/max based on the data from all series but they will also include zero (mostly since this is often data vis best practice, so we default to that). You can turn this off simply by setting yScale={{ type: 'linear', zero: false }}.

Again, there's more info in the other discussion about controlling the range, but hopefully this helps with your immediate problem!

Replies: 1 comment 1 reply

Comment options

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

Answer selected by davidhan527
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