Sparklines Visuals

A sparklines chart shows the general shape of the variation in measurement (usually over time) in a simple, condensed, and memorable manner. Sparklines are small and succinct, and can be easily located with the text where they are discussed. You can contrast this with typical X/Y charts that are designed to show as much data as possible.

The following steps demonstrate how to create a new sparklines visual representation on dataset World Life Expectancy [data source samples.world_life_expectancy]. For an overview of shelves that specify this visual, see Shelves for Sparklines Visuals.

  1. Start a new visual based on dataset World Life Expectancy [data source samples.world_life_expectancy]; see Creating Visuals.
  2. In the visuals menu, find and click sparklines.

    selecting sparklines chart type
  3. Note that the shelves of the visual changed. They are now X, Y, and Filters.

    The mandatory shelves for sparklines visuals are X and Y, representing the X-axis and Y-axis.

    shelves of sparklines visual type
  4. Populate the shelves from the available fields (Dimensions, Measures, and so on) in the Data menu.

    • Under Dimensions, select year and drag it over X shelf on the main part of the screen. Drop to add it to the shelf.
    • Under Measures, select gdp_per_capita and drag it over Y shelf on the main part of the screen. Drop to add it to the shelf.
  5. On the Y shelf, on gdp_per_capita field, click the icon (down arrow), select Aggregates, and then select Sum.

    This is necessary because the sparklines chart type uses aggregated measurements.

  6. Note that the Y shelf now contains the modified field sum(gdp_per_capita).

  7. Click Refresh Visual.

    The sparklines visual graph appears.

  8. On the Filters shelf, add several Dimensions and Measures from the Data menu.

    This enables you to dynamically control the data input, and discover the data at a more granular level.

    For example, from Dimensions, drag country, un_subregion, and un_region onto the Filters shelf.

  9. Click (pencil icon) next to the title of the visualization to edit it, and enter the new name.

  10. Change the title to World Population - Sparklines.
  11. At the top left corner of the Visual Designer, click Save.

    clicking to save

Sparklines Visuals in Action

To use this visual to see a sparklines chart for a specific country, such as Haiti, follow these steps.

  1. On the Filters shelf, click country, then click Pick values from a list.

  2. In the Pick values for a country modal window, select Haiti, then click Save.

  3. Click Refresh Visual.
  4. Note how the line changed compared to the previous display (world-wide).

To use this visual to see a sparklines for a region, such as Europe, follow these steps.

  1. Clear the selection in the existing filters.
  2. On the Filters shelf, click un_region, then click Pick values from a list.
  3. In the Pick values for un_region modal window, select Europe, then click Save.

  4. Click Refresh Visual.
  5. Note how the line changed.