Updated: September 25, 2017

Cumulation (Waterfall Chart)

Intro

Waterfall charts are used to analyze a cumulative value. They show how the cumulative value changes from an initial state to a final state by representing the accumulation of successive values.

 

Examples

Profit and Loss

The margin is a cumulative value equal to the sum of all revenues (positive) and all costs (negative).

Profit and loss waterfall chart
Profit and loss waterfall chart

Inventory over Time

The stock level is equal to the sum of all incoming stocks (positive) and outgoing stocks (negative).

Stock level over time waterfall chart
Stock level over time waterfall chart

Orientation

The orientation of the waterfall chart (horizontal or vertical) should follow best practices of the business area from which the application is designed.

If the chart represents how a cumulative value changes over time period, it’s best to use a vertical waterfall chart (with vertical bars) and a horizontal time axis.

If not, you should use a horizontal waterfall chart (with horizontal bars) to avoid the undesirable effects that come as a result of displaying the category labels at 45°, which apart from making them hard to read, often leads to truncation of text.

Total and Subtotal

The initial and the final values are usually represented by an entire column starting from the zero axis. An intermediate total can be added.

Waterfall chart with an intermediate total
Waterfall chart with an intermediate total

You can also add intermediate subtotals that are the sum of previous values.

Waterfall chart with an intermediate subtotal
Waterfall chart with an intermediate subtotal

Colors

Default Colors

By default, the chart use three colors based on the following semantic:
  • Positive values use a color defined by the property: plotArea.dataPoint.color.positive.
  • Negative values use a color defined by the property: plotArea.dataPoint.color.negative
  • Totals use a color defined by the property: plotArea.dataPoint.color.total
By default, these three colors are:
  • Blue (@sapUiChartPaletteSequentialHue1Light1)
  • Green (@sapUiChartPaletteSequentialHue2Light1)
  • Gray (@sapUiChartPaletteSequentialNeutral)

These colors are defined by the sequential palette, but can be customized.

Waterfall chart with default colors
Waterfall chart with default colors

Custom Colors

You can customize the colors in two ways:
  • Change the colors, or
  • Use your own rules.

Changing Colors

The colors color.positive, color.negative and color.total can be changed to any color from the chart palette. The chart will use these three colors based on the rules defined above.

Example: Positive and negative are blue, and total by gray.

Waterfall chart with custom colors
Waterfall chart with custom colors
Example: Positive are green and negative are red. Total is gray.
Waterfall chart with semantic colors
Waterfall chart with semantic colors

Using your Own Rules

You can set any color to any bar based on your own rules. To define the rules, use the property dataPointStyle:rules.

Use dataPointStyle:others to define the colors for all data points that are not covered by the rules. If the color of a data point is not defined, the data point will be displayed with a black color to indicate that no color has been defined.

Example: Direct costs and indirect costs use different shades of green from the sequential palette.
Waterfall chart with colors based on business rules
Waterfall chart with colors based on business rules

Resources

Want to dive deeper? Follow the links below to find out the SAPUI5 implementation.

Elements and Controls

Implementation