This is my first post so first of all thanks to the community and everyone helping and contributing!
After searching through the forum and the internet I did not seem to find the answer to my problem:
I am using plotly_events to plot a chart on which I activate a click_event function to get and save data of the point clicked on the graph.
Now the problem is that my app has a sidebar and when creating the chart I can’t format the figure so that it fits in the screen. When the sidebar is open the chart’s right side is out of the screen, but when the sidebar is closed the whole chart is within the screen.
The chart is plotted with: plotly_events(chart, click_event=True)
On the other hand when the chart is created with st.plotly_chart() it fits perfectly with in the app screen.
I have tried passing st.plotly_chart() to plotly_events( st.plotly_chart(), click_event=True).
which solves the displaying problem but then the click_event is not working.
The app includes an interactive chart that the user can change.
Following is the code where the chart is not fitted to the app screen unless I force it using predefined width and height.
Hi @nirco13 , sorry for the late reply. what would be the df and go be? Are those packages? Is it possible to copy and paste that is easily reproducible for me? Otherwise I would have to search for all the packages and guess on some of the code.
Usually df stand for a pandas dataframe and go for plotly graphic objects.
Instead of the df you can use simple arrays like np.array([1,2,3]).
The goal here is to understand how to use the streamlit keyword use_container_width within the community component plotly_events .