I'm aware that there is staticPlot option for disabling these features but it actually disables all interactive operations including tooltips and legends.
For charts that don't have much data points, these features unnecessary so it would be great if you guys add an option to disable zooming, panning and dragging.
In svg 2d plots, you can set layout.xaxis.fixedrange: true to disable zooming/panning along x and similarly using layout.yaxis.fixedrange: true in the y direction. More info on the reference page.
That said, this option hasn't been implemented for the webgl and maps plot types yet.
Oh, I missed them. Thanks for the fast response!
@buremba All good :beers: It is a pretty hidden feature.
How to do this for tables created via figure factory viz.
ff.create_table(df).
There seems to be no attribute called fixedrange in the output generated via ff.
How to do this for tables created via figure factory viz.
Please ask your questions on https://community.plot.ly/
@etpinard Thanks :)
I did not find “staticPlot: true” in the attribute reference. It should be added to the documentation.
In svg 2d plots, you can set
layout.xaxis.fixedrange: trueto disable zooming/panning along x and similarly usinglayout.yaxis.fixedrange: truein the y direction. More info on the reference page.That said, this option hasn't been implemented for the webgl and maps plot types yet.
This option disables browser-page optical zoom on tablets when a user tries to zoom the page by placing his fingers on the graph.
Why does putting xaxis.fixedrange: true, yaxis.fixedrange: true on the graph change the mouse cursor to pointer, as if the whole graph is clickable?
In case anyone comes looking for this feature like I did for Choropleth plots:
dragMode=False in the layout propertyscrollZoom=False in the config propertydisplayModeBar=False in the config property@jaspersardonicus
That was helpful. As far as I understand, in python, we can provide those configuration options to
config = dict({'scrollZoom': False})
fig.show(config = config)
I am using streamlit to show a plotly chart and cannot use the show() function, which opens the choropleth map in new window. Is there any other way we can set these config options.
Any help is appreciated. Thanks
Saw the issue
Most helpful comment
In svg 2d plots, you can set
layout.xaxis.fixedrange: trueto disable zooming/panning along x and similarly usinglayout.yaxis.fixedrange: truein the y direction. More info on the reference page.That said, this option hasn't been implemented for the webgl and maps plot types yet.