williaster / data-ui

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

Set minimum bar length for BarSeries #164

Closed gnijuohz closed 5 years ago

gnijuohz commented 5 years ago

When there is one large data point in the bar series, all the other bars would be reduced to nothing. In that case it's impossible to hover over them to show tooltips or click on the bars.

Is it possible to set a minimum bar length for the BarSeries (maybe via adding a minBarLength prop)?

williaster commented 5 years ago

Hi @gnijuohz thanks for checking out @data-ui. Do you have a code example you can link to? (easier to debug).

Setting a minimum bar height seems like it could be a bit misleading depending on how large you set it, but you should be able to define this with the scale range attribute (e.g., yScale={{ type: 'linear', range: [visHeight, minBarHeight] }}. This config maps almost directly to d3 scales which you can read more about here.

gnijuohz commented 5 years ago

@williaster Ah I think yScale will do! Will try that out.

@data-ui is neat! thanks for your great work!

williaster commented 5 years ago

awesome! closing for now 👍