Chart selections in streamlit 1.35 using plotty

Chart Selection is working for scatterplot created using plotty-express ,But not for any other chart types in plotty .A sample comparison between Pie chart and Scatter plot is below. Any help is appreciated ?

Python 3.12.3
Streamlit 1.35
plotly 5.22.0
plotly-express 0.4.1

import plotly.express as px
import numpy as np
import streamlit as st
st.set_page_config(layout="wide")
st.title("pie chart")

df = px.data.gapminder().query("year == 2007").query("continent == 'Europe'")
df.loc[df['pop'] < 2.e6, 'country'] = 'Other countries' # Represent only large countries
fig = px.pie(df, values='pop', names='country', title='Population of European continent')

event=st.plotly_chart(fig, use_container_width=True, key="cards3", on_select="rerun")
event # printing the selected vale in chart


st.title("scatter")

df = px.data.iris() # iris is a pandas DataFrame
fig = px.scatter(df, x="sepal_width", y="sepal_length")
event=st.plotly_chart(fig, use_container_width=True, key="cards4", on_select="rerun")
event```


![Screenshot 2024-06-07 at 1.09.06 PM|690x313](upload://mxBWk7vG0eJsb9j2JEoivgPwNnv.png)
![Screenshot 2024-06-07 at 1.09.57 PM|690x407](upload://uUXtJmKJVuZhYh32DZCfQIA84kU.png)