Hello! I am currently working with Vega-Lite’s interactive charts. Basically, I am trying to get the input from my bar chart and change the selection in a SelectBox based off of that value. I understand that I have to use on_select=“rerun” or a callable, but I’m having trouble connecting all the dots. Specifically, I’m not sure exactly the best way to reference the value that was input by the user from selecting the graph bar. If anyone can point me in the right direction it would be greatly appreciated.
Here is the current code for my bar chart:
errorCountChart = st.vega_lite_chart(
data_frame,
{
"mark": {"type": "bar", "color": "#38946b"},
"params": [{"name": "interval_selection", "select": "interval"}],
"encoding": {
"x": {"field": "Start Time", "type": "temporal"},
"y": {"field": "Error Count", "type": "quantitative"}
},
},
on_select="rerun"
)
And here is the current code for the SelectBox:
add_selectbox = st.sidebar.selectbox(
'View a specific session:',
data_frame['Start Time'],
index=None,
placeholder="No session selected",
key='sidebar-dropdown',
)