I need to prevent the dragging on the x axis (the one that moves the axis and its curves), but without loosing the zoom feature (selecting an area on the graph). I've found exactly this question on Plotly forum, but there aren't answers.
Copying the text for convenience:
I want to keep this functionality:
But I want to disable this:
My attempt was:
fig.update_layout({
'xaxis': {'fixedrange': True},
'xaxis2': {'fixedrange': True},
)}
This snippet blocks the x axis drag as well as the zoom. Selecting fixedrange
for only one of the axis blocks the dragging but the zoom goes bugged (zooming only the curves of one of the axes). Is there any way with plotly arguments or maybe by CSS (by adding a css file on assets folder), by preventing the click on the axis based on the id and maybe the children.