-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
When drawing a scatter plot with a mode of lines+marker
with an xaxis rangeselector
enabled, changing ranges results in a range being shown that isn't relative to the actual data itself.
My example is at https://codepen.io/davidjb/pen/dJYWaV (a fork of the example from https://plot.ly/javascript/range-slider/) -- changing between lines
and lines+markers
down the very bottom shows the difference in behaviour.
With a mode of lines
, a plot's X axis ends where the data does, and so choosing 1m
, 6m
and so in the range selector result in a plot that shows that during from the end of the dataset. In lines+markers
, however, choosing a range is relative to the end of the original plot, resulting in an empty or partially empty plot because the range will extend past the end of the dataset. Depending on how spread out your data is, this could result in a fully empty plot (like the example, where it shows a range in 2019 for a dataset in 2016) or a partially visible trace on the left-hand side.
My expectation was that the rangeselector
would always operate relative to the data -- so in this case being the same behaviour between lines
and lines+marker
.
Seems related to #928, with regards to the 'padding' on the far right of the plot. Example tested with plotly.js 1.13.2 (latest at time of writing).