Areas

In CDP Data Visualization, Area charts are a good choice for representing related values over time because they emphasize the relative proportions of totals or percentage relationships. With volume stacked beneath the line, the chart clearly demonstrates both the total of the fields and their relative size.

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

  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 Areas.
    selecting area chart type
    selecting area chart type
  3. Note that the shelves of the visual changed. They are now X Axis, Y Axis, Colors, Tooltips, Drill, Labels, and Filters. The mandatory shelves are X Axis and Y Axis. Note also that the fields placed on these two shelves may be easily swapped by switching X and Y.
  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 X shelf on the main part of the screen. Drop to add it to the shelf.
    2. Under Measures, select population and drag it over Y shelf on the main part of the screen. Drop to add it to the shelf.
  5. Change the aggregate of the population field from sum(population) to avg(population):
    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.

      Click Refresh Visual.

      The area visual appears.

  6. Alias the year field as Year, and the population field as Population:
    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.
  7. To see the individual countries, select the country field from the list of Dimensions and drag it onto the Colors shelf.
  8. [Optional] On the Tooltips shelf, add several fields from Dimensions and Measures.

    This enables you to see specific descriptive information in your visuals, such as input values, segment affiliation, and calculations.

    For example,

    1. From Measures, drag gdp_per_capita and life_expectancy onto the Tooltip shelf.
    2. From Dimensions, drag country, un_subregion, and un_region onto the Tooltip shelf.
    3. For all items on the Tooltip shelf, click the (down arrow) icon, select Aggregates, and then select Remove Aggregate.
    4. For all numeric items on the Y shelf and the Tooltip shelf, click the (down arrow), icon select Display Format, and enter ,.2f.

      Note that these fields are typically from the Measures menu, and in this example include gdp_per_capita and life_expectancy.

  9. 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, un_region, and year onto the Filters shelf.

  10. On the Filters shelf, click the (down arrow) icon on the un_region field.
  11. Select Pick values from a list.
  12. In the Pick values for un_region modal window, select Africa, then click Save.
  13. Click Refresh Visual.

    The updated area visual appears.

  14. Click (pencil icon) next to the title of the visualization to edit it, and enter the new name.
  15. Change the title to World Population - Area.
  16. At the top left corner of the Visual Designer, click Save.