I am creating a candlestick plot using plotly.py. I would like to have a horizontal split and place the candlestick data in the top split and some data curves in the bottom bottom split. I do not need panning and zooming and that lower section of the candlestick chart with the zoom/pan controls is getting in my way.
To disable zoom and panning you need to set:
layout.xaxis.fixedrange = true
and layout.yaxis.fixedrange = true
.
To hide the controls you need to set displayModeBar = false
.
In Python this would for example look like this:
dcc.Graph(
id='my-id',
config={'displayModeBar': False},
'layout': go.Layout(
xaxis={'title': 'x-axis','fixedrange':True},
yaxis={'title': 'y-axis','fixedrange':True})
)
I disabled it with layout.xaxis.rangeslider.visible = false
It is possible to disable individual buttons from the bar.
See the Plotly Python documentation on the configuration
object: https://plotly.com/python/configuration-options/#removing-modebar-buttons
example code:
fig.show(config={ 'modeBarButtonsToRemove': ['zoom', 'pan'] })
do that ont the figure before show():
fig.update_xaxes(rangeslider_visible=False)
fig.show()
fig.update_xaxes(rangeslider_visible=False)
–
Heelpost If you save the file using the control save method, I think that it disables the zoom/pan function. Around October, I had a similar issue, and when I simply saved the chart, the zoom/pan function went away. Let me know if that works.
© 2022 - 2024 — McMap. All rights reserved.