I have a chart where I want to display long text as tooltips. The text contains a couple of sentences, I therefore would like to specify a line break or the width of the tooltip box. Currently the tooltip is displayed as a single line having a width that exceeds the browser window and is therefore not readable.
Update:
As a workaround I could solve this by simply encoding the tooltip channel as an array. Instead of having
Chart.encode( tooltip=alt.Tooltip('field', title='title') )
using the following syntax solved the issue and created a tooltip box for even long text
Chart.encode( tooltip=[alt.Tooltip('field', title='title')] )
` or other ways to split long strings atm so you can suggest this feature on their issue tracker. This is question is a duplicate of https://stackoverflow.com/questions/65798037/altair-tooltips-is-there-a-way-to-format-box-shape-for-long-text – joelostblom Jun 11 '21 at 17:22