Tracking Tooltip
A tracking tooltip is a small overlay that follows the cursor and shows the value under it. Turn it on by passing tooltip=tvl.tooltip() to tvl.chart(...):
tooltip=True is shorthand for the same thing, and tooltip=False is the same as leaving it out:
The tooltip box appears near the cursor as you move across the chart, showing the series title, its value at that time, and the time itself. It hides automatically when the cursor leaves the plot area.
A single focused series
The tooltip always shows exactly one series: the one in focus. In a single-series chart that is the series you plotted. In a multi-series chart the focused series is whichever line is vertically nearest the cursor within the time slice under it: the chart reads each series’ value at that time and picks the one closest to the cursor’s height. As you move the cursor up and down between overlaid lines, the tooltip switches to track whichever line is nearest.
The tooltip stays the same size no matter how many series the chart has. To see every series at once, add a legend. The title line is drawn in the focused series’ color.
What the tooltip shows
Passing a tooltip is what turns it on; its arguments refine what each tooltip displays:
| Argument | Default | Effect |
|---|---|---|
show_title | True | Show the series title line (the series title, or its id when untitled), tinted with the series color. |
show_value | True | Show the series value at the cursor. For candlestick and bar series this is the close. |
show_date | True | Show the time/date line, formatted the same way as the time axis. |
The value is formatted by the focused series’ own price format, so the tooltip agrees with the price axis; set price_format on the series to change its decimals.
Colors come from the theme
The tooltip has no color options. Its background, text, and border are drawn from the active Deephaven theme so it always matches the rest of the UI, in light and dark themes alike. The one piece of per-series color is the title line, which is tinted automatically with the focused series’ color. If you restyle a series’ color, its tooltip title follows.
Tooltip and crosshair
The tooltip tracks the chart’s crosshair, so it works together with tvl.crosshair(mode=...). With the default magnet crosshair the reported value snaps to the nearest data point; with tvl.crosshair(mode="normal") it follows the cursor freely. The tooltip works with any crosshair mode; the mode only changes which point the value is read from.
API Reference
The tooltip is configured with a grouped object: tvl.tooltip(...) returns a
Tooltip that you pass to tooltip= on tvl.chart(...). For the full
tvl.chart signature, see the Chart container page.
Create a Tooltip config for tvl.chart(tooltip=...).
Returns: Tooltip A tracking-tooltip config for tvl.chart(tooltip=...).
tvl.chart(tooltip=True) is shorthand for this with all defaults,
and tooltip=False (or omitting it) means no tooltip.
| Parameters | Type | Default | Description |
|---|---|---|---|
| show_title | bool | None | None | Show the series title line. |
| show_value | bool | None | None | Show the series value at the cursor. |
| show_date | bool | None | None | Show the time/date line. |