Sankey visualization

Sankey visualizations are a type of flow chart in which the width of the arrows is proportional to the flow rate.

About this task

For more information about the Sankey custom visualization sample on IBM Accelerator Catalog, see https://community.ibm.com/accelerators/catalog/content/Sankey.

Note: The Sankey visualization does not work in Microsoft Internet Explorer 11.

Sankey visualizations can show the energy accounts, material flow accounts on a regional or national level, and cost breakdowns. Sankey visualizations emphasize the major transfers or flows within a system. They help locate the most important contributions to a flow. They often show conserved quantities within defined system boundaries.

To view the source code and packed bundle (.zip file) for the sankey 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.

Sankey visualizations are supported as of IBM® Cognos® Analytics 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.
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.
  • 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 Sankey 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 theCustom visuals, select the Sankey visualization.
  4. Upload Sankey_sample_data.xlsx (https://public.dhe.ibm.com/software/data/sw-library/cognos/mobile/C11/custom_visualizations/data/Sankey_sample_data.xlsx) and use it as the data source.
  5. Create the pane Sankey visualization by dragging the following data items from Sankey_sample_data.xlsx in the Sources pane Data icon:
    • Drag From onto the From field.
    • Drag To onto the To field.
    • Drag Weight onto the Weight field.

    This sample Sankey visualization displays the flow of loan applications through a fictional bank’s mortgage approval system. It displays the distribution of applications in the various stages and outcomes of the interview. The width of the connection indicates the volume of applicants.

    Gas gauge custom visualization

What to do next

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

Property Purpose
Node alignement Set the alignment of the node:
  • Justify
  • Left
  • Rigth
  • Center
Node width Set the width of the node.
Node padding Set the padding of the node.
Node border thicknes Set the thickness of the borders of the node.
Suppress unused Suppress unused data
Labels: Properties for the labels
Vertical alignment Set the vertical alignment of the labels:
  • Default
  • Top
  • Bottom
Show labels Show or hide the labels.
Label wrapping If the labels are long, you can set to wrap the labels on a next line.
Hide colliding labels If labels collide, you can set to hide the colliding labels.
Include nodes Show / hide labels that collide with nodes.
Fill type Set the fill type of the nodes:
  • Gradient
  • From
  • To
  • Fill solid
Consider negative weight Set the angle of the axis.