Population visualization

A population visualization, also called an age-gender-pyramid, is a visualization that shows the distribution of various age groups in a population.

About this task

For more information about the population custom visualization sample on IBM Accelerator Catalog, see Population.

Males are conventionally shown on the left and females on the right, and they can be measured by raw number or as a percentage of the total population. Use this visualization to display age of a particular population. It is also used in ecology to determine the overall age distribution of a population.

Population visualizations are supported as of IBM® Cognos® Analytics with Watson 11.1.6

Note: This example was created for advanced custom visualization developers. It is a code sample with specific requirements and does not include all the features, interactivity, and properties of an out-of-the-box Cognos visualization. It is intended to provide a baseline for developers to extend their visualizations. If you are not an advanced visualization developer, Cognos Analytics already delivers a full set of fully-featured and powerful visualizations that are ready to use.

To view the source code and packed bundle (.zip file) for the population sample custom visualization, go to this public GitHub repository. To download the files, navigate to the root of this directory and click Clone or download.

For more information about custom visualizations, see Developing custom visualizations. For an excellent tutorial to get you started, see Custom visualizations - tutorial.

There are two ways to use the custom visualization:
  • You can download the packed bundle (.zip file) and upload it directly into IBM Cognos Analytics with Watson.
  • You can download the source code to create your own version of it to pack and upload into Cognos Analytics.

The following steps demonstrate how to use the population visualization and populate it with data.

Procedure

  1. Create a dashboard and click the Visualization Change visualization icon icon in the toolbar.
  2. Click the Custom tab.
    If there are no custom visuals available, then you can add a custom visual by clicking the Add a custom visual Add a custom visual icon on the Custom tab.
  3. From the Custom visuals, select the population visualization.
  4. Upload Population_sample_data.xlsx (https://public.dhe.ibm.com/software/data/sw-library/cognos/mobile/C11/custom_visualizations/data/Population_sample_data.xlsx) and use it as the data source.
  5. Create the pane population visualization by dragging the following data items from Population_sample_data.xlsx in the Sources pane Data icon:
    • Drag Gender onto the Split categories field.
    • Drag Age onto the Y categories field.
    • Drag Value onto the Value field.
    Gas gauge custom visualization

What to do next

An explanation of the specific properties within this visualization that can be adjusted:

Property Purpose
Current color palette Set the current color palette.
Element color Set the color of the element.
Font family Set the font.
Font size Set the size of the font.
Animation duration Set the duration of the duration in milliseconds.
Maximum swatch item width Set the maximum of the swatch item.