Adding Highlights to Visuals

Highlights are a practical way to bring attention to values that exceed a particular threshold. Arcadia Data currently supports highlight marks at specific values on the combined bar/line chart type, and enables you to customize these highlights.

Specifying Highlight Values

The following steps demonstrate how add highlights to an existing chart. To start, we are using the visual World Population - Dual Bar and Line, developed on dataset World Life Expectancy [data source samples.world_life_expectancy]. See Combined Bar and Line Visuals.

  1. Open the visual World Population - Dual Bar and Line in edit mode. For information on building this visual, see Combined Bar and Line Visuals.
  2. Clone the visual.

    clone the visual
  3. Click Edit next to the title of the visualization.

  4. Change the title to World Population - Highlights on Dual Bar and Line.
  5. Above the left navigation bar, click Save.

  6. Add the un_region field to the Filters shelf, and select Europe from the list of possible values.

    This graph has more variation than the unified World data.

  7. Click Refresh Visual.

    initial setup for highlights: World Population dual graph, un_region=Europe
    Dual Bar and Line Graph, UN Region = Europe
  8. Note the pronounced peak in the GDP per Capita line, centered around the year 2005.

    Based on the graph, let's highlight the values where GDP per Capita is over $25,000.

  9. Place the field gdp_per_capita on the shelf Highlight Mark Measure.

  10. On the same shelf, click the icon (down arrow) on the gdp_per_capita field, and choose Enter/Edit Expression.
  11. In the Enter/Edit Expression window modal, delete the text in the default expression, change the function groupings to Conditional, and select the if statement.

    Depending on the SQL dialect of the connection you are using, the syntax of the if statement may be different.

    initial expression setup
    Choosing the Function Template
  12. Complete the expression template. It should look similar to the following expression:

    if(avg([gdp_per_capita])>=25000, avg([gdp_per_capita]), null)

    Optionally, you can alias the highlight; see the bold font in the changed expression.

    if(avg([gdp_per_capita])>=25000, avg([gdp_per_capita]), null) 
    as 'GDP per Capita > 25K'
  13. Click Save.

    expression and alias
    Conditional Expression and Alias
  14. Save the visual, and then click View to change to view mode.

    change to View mode
  15. Note that the graph has green circle highlights when GDP per Capita values are equal or greater than 25,000.

    initial setup for highlights: World Population dual graph, un_region=Europe
    Graph with Highlights at GDP per Capita >= 25K

Customizing Highlights

The default highlight mark is a circle. To convert it to another type, use the visual Settings interface, as described in Changing the Highlight Type. You can also change the relative size of the mark, as described in Changing the Size of the Highlight.