-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Should we auto-type axes w/o data arrays by their range values? #3487
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
Comments
Try var layout = {
xaxis: {
autorange: false,
type: 'date',
range: [
'2019-01-22',
'2019-01-23'
],
tickformat: '%H:%M',
}
};
Plotly.newPlot(
'plot-nodata',
[
{
x:[],
y: [],
type: 'scatter'
}
],
layout); i.e. adding Explanation: plotly needs to know that you're dealing with a Now, perhaps inputting an axis range like you did |
Thanks @etpinard! That explains the behavior and Detecting In any case, my issue is solved thanks to your suggestion. I'll leave the issue open in case you would like to track improvements so others can avoid the issue. If not, feel free to close. |
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 |
If
data.x
anddata.y
are empty,layout.xaxis.range
andlayout.xaxis.tickformat
are ignored and the plot is rendered with an x axis range from -100% to 600%. The issue can be worked around by adding at least one data point with anull
y value. For an example, see https://jsbin.com/nohugit/edit?html,js,output where the first plot has no data and the second has a singlenull
data point.In case it is relevant, my use case is generating several adjacent plots from different types of collected data where gaps in the data are not uncommon. Occasionally a plot will have no data during the selected time range, in which case it is desirable to render an empty plot with an x axis range which matches the other plots.
Thanks for considering,
Kevin
The text was updated successfully, but these errors were encountered: