Skip to content

[xy-chart] How to make axis labels vertical or angled somehow? #1000

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

You must be logged in to vote

Hey @RIP21, good questions. These parts of XYChart actually map pretty cleanly to other visx packages, let me take your questions one by one.

I guess I can just divide by the length of dataset to show no more than 10 or 20 or whatever.

To reduce ticks, you can use Axis numTicks: number (which is approximate! due to the underlying d3 algorithm), you can specify exact tick values you want via tickValues: TickValue[], or you could render all ticks and simply render no label for some of them (e.g., every other). To do the latter you would use tickFormat (see demo in next question).

But is it possible maybe to draw these ticks vertically? Or maybe stack them?

The prop you're looking for he…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RIP21
Comment options

@VigneshTrantor
Comment options

@andrewfschorr
Comment options

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