williaster / data-ui

A collection of data-rich UI components 📈
https://williaster.github.io/data-ui/
MIT License
546 stars 69 forks source link

How to set XYchart yAxis rangepadding #189

Closed mcassels closed 5 years ago

mcassels commented 5 years ago

Hi, is there a way to set the rangePadding of the yAxis in an XYchart? I saw that XYchart sets the xAxis rangePadding to xScale.offset, but the yAxis rangePadding to null.

I want to create space at the top of the chart above the highest data point (i.e. want the yAxis to extend somewhat above the data range). Thanks!

williaster commented 5 years ago

👋 @mcassels, thanks for checking out @data-ui. Looks like you're correct that we override rangePadding to null which I'd consider a 🐛.

I pushed a quick fix in #190 , as a temporary work around until I can release a new version (next few days) you could explicitly define the desired domain in XYChart.props.yScale object with the desired extra padding. This will be annoying if you don't already know the extent of data but might be better than nothing.

mcassels commented 5 years ago

Great, thank you!!

williaster commented 5 years ago

this should be fixed in @data-ui/xy-chart@0.0.81