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

Single-datum bar trace with specified time range not showing #1346

Closed
henryzhao95 opened this issue Jan 31, 2017 · 7 comments
Closed

Single-datum bar trace with specified time range not showing #1346

henryzhao95 opened this issue Jan 31, 2017 · 7 comments
Labels
bug something broken

Comments

@henryzhao95
Copy link

For a bar chart with time on the x axis, only one data point, and a specified x axis range in the layout options, the chart does not display.

After a second data point is added, the chart displays as normal.

http://codepen.io/anon/pen/GryLNg

@n-riesco
Copy link
Contributor

I've had a quick look at this issue and I've noticed that:

  • Plotly v1.19.2 and earlier shows a bar but ignores layout.xaxis.range
  • Plotly v1.20.0 and above doesn't show a bar but it honours layout.xaxis.range

This would point towards #1142. I'm not sure how. Anyhow, I'm guessing this issue is caused by the binning algorithm (that only uses data[0].x to compute the bin size).

@etpinard
Copy link
Contributor

Thanks for the report @henryzhao95 !

@etpinard etpinard added the bug something broken label Jan 31, 2017
@etpinard

This comment has been minimized.

@etpinard
Copy link
Contributor

etpinard commented Feb 20, 2017

After a closer inspection, the bar in http://codepen.io/anon/pen/GryLNg fails to render because the bar plot step thinks that it has zero width here where x0 === x1.

By removing the set xaxis range value, we get:

image

which is a bar of 0.8 of a millisecond - which is arguably not a very good default on date axes.

@henryzhao95 by manually setting the bar width, you can archive a better-looking result, see http://codepen.io/etpinard/pen/XpLvWv


Perhaps we should make the default bar width for single-datum traces fixed in pixel space?

Referencing #1229 and #1308 which also highlight a few inconsistencies in single-datum bar traces.

@etpinard
Copy link
Contributor

@etpinard
Copy link
Contributor

Similar to #1181

@gvwilson
Copy link
Contributor

gvwilson commented Jun 6, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

@gvwilson gvwilson closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants