airbnb / visx

🐯 visx | visualization components
https://airbnb.io/visx
MIT License
19.52k stars 715 forks source link

[axis] tick label rotation? #810

Closed alangrn closed 4 years ago

alangrn commented 4 years ago

Any plans to implement something like axisLabelRotate as pr the example here: https://blog.scottlogic.com/2019/05/09/building-a-better-d3-axis.html

https://github.com/d3fc/d3fc/tree/master/packages/d3fc-axis

https://github.com/d3fc/d3fc/blob/master/packages/d3fc-axis/src/axisLabelRotate.js

williaster commented 4 years ago

From a vis best-practice point of view I would recommend against rotated axis tick labels because they are harder for you viewers to read. First I'd consider

Otherwise, we do already support this by passing an angle value in tickLabelProps for @visx/axis. This is passed to @visx/text, which does the right thing

https://codesandbox.io/s/stoic-https-5uv3i?file=/Example.tsx

image