Tool tips in fullscreen mode for charts

Tool tips for the bar charts works for me in regular mode . When “view full screen” mode is used , tool tips are not shown . How do i resolve this ?

Hi @dataexplorer, welcome to the Streamlit community!

Could you give a brief code snippet of what you are doing, so that I can try it out on my computer?

Best,
Randy

I have the same issue. Tooltips in fullscreen do not seem to show up in Altair’s mark_line charts.
Here’s code to reproduce the issue:

demo_df = pd.DataFrame({
    'timestamp': [pd.Timestamp(2020, 1, i) for i in range(1, 31)],
    'value': np.random.randn(30).cumsum()
})
demo = alt.Chart(demo_df).mark_line().encode(
    x='timestamp:T',
    y='value:Q',
    tooltip=['value', 'timestamp']
).interactive()
st.altair_chart(demo, use_container_width=True)

I checked the Altair / Vega library for any hints, but unsuccessful so far.
So any help is appreciated!

Best,
Quinten

Hello @quinten,

Actually the tooltips really are present in wide screen (at least for me, is it what you call fullscreen ? It also works in fullscreen for me though…), but you’ll need to be very precise to select a point on the line chart where tooltips are defined:

I usually recommend adding some point markers to show where the tooltip can occur:

demo_df = pd.DataFrame({
    'timestamp': [pd.Timestamp(2020, 1, i) for i in range(1, 31)],
    'value': np.random.randn(30).cumsum()
})
base = alt.Chart(demo_df).encode(
    x='timestamp:T',
    y='value:Q',
    tooltip=['value', 'timestamp']
)
line = base.mark_line()
points = base.mark_point(filled=True, size=40)
chart = (line + points).interactive()
st.altair_chart(chart, use_container_width=True)

I think there’s a “select closest point” in the Altair docs, I don’t remember where…

Best,
Fanilo

Hello Fanilo,

Thanks for your quick reply!
What I mean by “full screen” is clicking on the expand arrows when hovering on a container plot (see image). On the image below, the tooltip works indeed great when not expanded!

However, in fullscreen, this tooltip disappears. Even when hovering clearly over the mark_points.

I can’t seem to get a tooltip pop up in the second case.
I’'ll look into the 'select closest point", but it’s not working for me in MacOS Big Sur, latest build (Version 87.0.4280.67).

Best,
Quinten