Opening a chart with a predefined zoom level

Hello,

I have a a gantt chart with too many data points, I would like to write a code snippet that renders the chart prezoomed, I already tried the layout scene, however it does not seem to have any effect
scene = list(camera = list(eye = list(x=0,y=25)))
plot ← plot %>% layout(scene = scene)

Is that possible to be achieved?

Thanks in advance.

I solved the issue by using the axis range, below is the code snippet
%>%layout(
xaxis = list(range = list(0, 4)),
yaxis = list(range = list(0, 15)))
Upon double clicking it will reset.

2 Likes

Hi @mo.ezzat welcome!
Glad you could find a solution and thank you for sharing it with us here. You can tag your comment as β€œsolution”

2 Likes