Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Extra space on after y axis and at the end of chart

Extra space is added to the left and right side of the chart,When the mode is “markers+lines”
When the mode is just “lines” it is working fine no extra space is there.
https://codepen.io/anon/pen/brjGJV

https://user-images.githubusercontent.com/9054196/29655896-2143dc7c-88d0-11e7-9cc4-f2c4517e3b18.png

Any idea how this can be fixed?

Thanks

Simply set xaxis.range or yaxis.range

See https://github.com/plotly/plotly.js/issues/1775 for more info

Or subscribe to https://github.com/plotly/plotly.js/issues/1876 for news on potential improvements.

I had the same problem, I got it working by adding this range: [0,x.length-1], that works fine assuming that the x labels are unique

https://codepen.io/juanv911/pen/dLzwLV

if use range to control this, the final output would be weird when the range slider is used.