Edit Tooltips

Published on October 29, 2015

Tooltips are the additional details that display when you hover the mouse or pointer over a mark or field in a visual. They remain hidden otherwise.

In this post, I’ll show you how to add information about a particular field in a visual that shows only when you hover over that field.

Use case

We are working with the dataset SFPD Reported Incidents for 2013 [data source]. From this dataset, we have created a subset showing data of the reported incidents in the year 2014.

I’m also using a Scatter Plot to visualize this data. I want the tooltips to show whether the occurrence of incidents for a particular category is very low, low, medium, high, or extremely high.

Prerequisites

You must have access to the SFPD Reported Incidents dataset. If you do not have this dataset, you can install it in Arcadia Data by completing the following tasks:

Editing Tooltips

To edit tooltips, follow these steps:

  1. Create a Scatter Chart using the following attributes:
    • Place incidentnum field onto the X shelf.
      Change the field’s aggregate to count, for count(incidentnum).
    • Place category onto the Y shelf.
    • Place incidentnum field onto the Color shelf.
      Change the field’s aggregate to count, for count(incidentnum).
    • Place incidentnum field onto the Size shelf.
      Change the field’s aggregate to count, for count(incidentnum).
    • Place category field onto the Tooltip shelf.
    • Place date field onto the Filters shelf. Change the field’s aggregate to year.

      image00

  2. On the Tooltip shelf, click the drop-down icon to the right of the Category field.

    image01
    A drop-down menu appears.

  3. Click Enter/Edit Expression.

    image02

  4. Enter/Edit Expression window appears.
    In the Enter/Edit Expression window, enter the following expression:
    case when count ([incidntnum]) >= 75 then 'Extremely High' when count ([incidntnum]) >= 50 and count ([incidntnum]) < 75 then 'High' when count ([incidntnum]) >= 25 and count ([incidntnum]) < 50 then 'Medium' when count ([incidntnum]) >= 5 and count ([incidntnum]) < 25 then 'Low' else 'Very Low' end as 'Incident Occurrence'

    image03

  5. Click Save.
  6. Click Refresh Visual.
  7. On the chart, hover the mouse over a small bubble.

    image04
    The tooltip shows Incident Occurrence Very Low, as well as other details about the bubble.

  8. Hover the mouse or pointer over a big bubble.

    image05
    The tooltip shows Incident Occurrence Extremely High.