Skip to content

[BoxPlot] How to create an offset with time based X axis #1063

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

You must be logged in to vote

Hey @LoiKos 👋 thanks for checking out visx. I think the answer to this depends on whether you need a scaleUtc (time) scale, or if you would consider a band scale which will evenly space strings representing your dates.

Band scales support a padding which will leave space on the sides for you (see this discussion for more #1035). Note that this is the type of scale we use in our BoxPlot demo.

If you need a time scale, you will have to manually add a margin on the left/right of the chart so that your labels don't get clipped (content in SVGs gets clipped by HTML parents, which is why your labels are cutoff). Looks like you're already using a bottom margin to accommodate the x-axis, so you'd…

Replies: 1 comment 1 reply

Comment options

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

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