Calmcode - altair: tooltip

Create a basic scatter chart in Altair in Python.

1 2 3 4 5 6 7 8 9

One of the best features of altair is the ability to add a simple interactive tooltip to your chart.

Altair Tooltip Example

Here's how you can add the tooltip.

(alt.Chart(plot_df)
  .mark_point(color='black')
  .encode(x='yday', y='births', tooltip=['date', 'births', 'wday'])
  .properties(width=600, height=300)
  .interactive())

The nice thing about the tooltip parameter is that you can choose the subset of columns to add to the overview.