Creating Basic Combo Visuals

The following steps demonstrate how to create a new combined bar and line chart on dataset World Life Expectancy [data source samples.world_life_expectancy].

  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 Combo (row 1, column 5).

    selecting combo chart type
  3. Note that the shelves of the visual changed. They are now Dimension, Bar Measure, Line Measure, Tooltips, Highlight Mark Measure, Tooltips, and Filters.

    The mandatory shelves for bar and line visuals are Dimension that maps to the X-axis.

    Bar Measure and Line Measure both map to the Y-axis.

    shelves of combo 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 Dimension shelf on the main part of the screen. Drop to add it to the shelf.
    • Under Measures, select life_expectancy and drag it over Bar Measures 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 Line Measures shelf on the main part of the screen. Drop to add it to the shelf.
  5. Change the aggregate of the life_expectancy field from sum(life_expectancy) to avg(life_expectancy):

    • On the shelf of the visual, click the icon to the right of the field.

    • In the Column Properties menu, click the icon next to Aggregates.

    • From the list of aggregate functions, select Average.

      changing the aggregation to average
    • Click icon at the top of the Column Properties menu to close it.

    • Note that the shelf now contains the modified field with avg() aggregation function.

  6. Similarly, change the aggregate of the gdp_per_capita field from sum(gdp_per_capita) to avg(gdp_per_capita):

    • On the shelf of the visual, click the icon to the right of the field.

    • In the Column Properties menu, click the icon next to Aggregates.

    • From the list of aggregate functions, select Average.

      changing the aggregation to average
    • Click icon at the top of the Column Properties menu to close it.

    • Note that the shelf now contains the modified field with avg() aggregation function.

  7. The shelves of your visual should now look something like the following image:

    basic shelf configuration of bar and line chart type
  8. Click Refresh Visual.

    The bar and line visual appears.

    Note that the two legends for the Y axis match the color of the plot: the orange line for sum(gdp_per_capita), and the blue for the blue bars for avg(life_expectancy). However, you may not be able to see the bars because the values of that measure are so much smaller than the values for the line measure.

  9. Alias the life_expectancy field as Life Expectancy, and the gdp_per-capita field as GDP Per Capita according to these steps:

    • On the shelf of the visual, click the icon to the right of the field.

    • In the Field Properties menu, click the icon next to Alias.

    • In the text box below Alias, enter the alias name of column, as it should appear in the visual.

    • Click icon at the top of the Field Properties menu to close it.

    • Note that the shelf now shows the column with its alias name.

  10. Click Refresh Visual again.