Creating basic combos

CDP Data Visualization enables you to create Combo charts.

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].

For an overview of shelves that specify this visual, see Shelves for combos.

  1. Start a new visual based on dataset World Life Expectancy [data source samples.world_life_expectancy]; see Creating a visual.
  2. In the visuals menu, find and click Combo.
    selecting combo chart type
    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.
    1. Under Dimensions, select year and drag it over Dimension shelf on the main part of the screen. Drop to add it to the shelf.
    2. 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.
    3. 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):
    1. On the shelf of the visual, click the caret-right icon to the right of the field.
    2. In the Column Properties menu, click the caret-right icon next to Aggregates.
    3. From the list of aggregate functions, select Average.
      changing the aggregation to average
    4. Click x icon at the top of the Column Properties menu to close it.
    5. Click x icon at the top of the Column Properties menu to close it.
  6. Similarly, change the aggregate of the gdp_per_capita field from sum(gdp_per_capita) to avg(gdp_per_capita):
    1. On the shelf of the visual, click the caret-right icon to the right of the field.
    2. In the Column Properties menu, click the caret-right icon next to Aggregates.
    3. From the list of aggregate functions, select Average.
      changing the aggregation to average
    4. Click x icon at the top of the Column Properties menu to close it.
    5. Click x icon at the top of the Column Properties menu to close it.
  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. To see the bars, Assign a measure to a secondary axis.

  9. Alias the life_expectancy field as Life Expectancy, and the gdp_per-capita field as GDP Per Capita according to these steps:
    1. On the shelf of the visual, click the caret-right icon to the right of the field.
    2. In the Field Properties menu, click the caret-right icon next to Alias.
    3. In the text box below Alias, enter the alias name of column, as it should appear in the visual.
    4. Click x icon at the top of the Field Properties menu to close it.
    5. Note that the shelf now shows the column with its alias name.
  10. Click Refresh Visual again.