Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default min interval for single values #840

Open
nickofthyme opened this issue Sep 30, 2020 · 2 comments
Open

Default min interval for single values #840

nickofthyme opened this issue Sep 30, 2020 · 2 comments
Labels
:data Data/series/scales related issue enhancement New feature or request :xy Bar/Line/Area chart related

Comments

@nickofthyme
Copy link
Collaborator

nickofthyme commented Sep 30, 2020

Is your feature request related to a problem? Please describe.
Yes, when using a histogram chart with a single bar and custom xDomain (setting min and/or max). The single bar is not displayed because we cannot compute a sensible interval.

Related to #836 & #1184

See https://codesandbox.io/s/flamboyant-tdd-b0hzt?file=/src/App.tsx

Describe the solution you'd like
A fallback minInterval of say 1/16 or 1/20 of the domain should be used to at least render the single value.

There should also be a development warning to indicate that we are shooting in the dark trying to set a practical interval based on the data and domain provided, and that the consumer should provide a value.

Describe alternatives you've considered
Set the minInterval whenever there is a single value.

@nickofthyme nickofthyme added enhancement New feature or request :data Data/series/scales related issue :xy Bar/Line/Area chart related labels Sep 30, 2020
@monfera
Copy link
Contributor

monfera commented Aug 18, 2021

A fallback minInterval of say 1/16 or 1/20 of the domain should be used to at least render the single value.

This assumes a medium long aspect ratio for the time domain. If x=time, and the chart is narrow as it can be on a dashboard, 1/16...1/20 may yield an overly thin spike bar, and if it's a full 27" screen width, then an overly wide bar

@nickofthyme
Copy link
Collaborator Author

⬆️ This was just an initial thought. The time approximation assumes a unit time to determine the best interval. @markov00 discussed moving this prop to the BarSeries spec and making it required. I think that is a better solution for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:data Data/series/scales related issue enhancement New feature or request :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants