waterfallPlot

fun waterfallPlot(data: Map<*, *>, x: String, y: String, measure: String? = null, group: String? = null, color: String? = null, fill: String? = null, size: Number? = null, alpha: Number? = null, linetype: Any? = null, width: Number? = null, showLegend: Boolean? = null, relativeTooltips: Any? = null, absoluteTooltips: Any? = null, calcTotal: Boolean? = null, totalTitle: String? = null, sortedValue: Boolean? = null, threshold: Number? = null, maxValues: Int? = null, hline: Any? = null, hlineOntop: Boolean? = null, connector: Any? = null, label: Any? = null, labelFormat: String? = null): Plot

A waterfall plot shows the cumulative effect of sequentially introduced positive or negative values.

Notes

Computed variables:

  • ..x.. : category id.

  • ..xlabel.. : category name.

  • ..ymin.. : lower value of the change.

  • ..ymax.. : upper value of the change.

  • ..measure.. : kind of a calculation: absolute, relative or total.

  • ..flow_type.. : direction of the flow: increasing, decreasing, or the result (total).

  • ..initial.. : initial value of the change.

  • ..value.. : current cumsum (result of the change) or absolute value (depending on the "measure" column).

  • ..dy.. : value of the change.

Examples

Parameters

data

The data to be displayed in this layer.

x

Name of a variable.

y

Name of a numeric variable.

measure

Kind of a calculation. Values in 'measure' column could be:

  • "absolute" - the value is shown as is;

  • "relative" - the value is shown as a difference from the previous value;

  • "total" - the value is shown as a cumulative sum of all previous values.

group

Grouping variable. Each group calculates its own statistics.

color

Color of the box boundary lines. For more info see: aesthetics.html#color-and-fill. Use "flow_type" to color lines by the direction of the flow.

fill

Fill color of the boxes. For more info see: aesthetics.html#color-and-fill. Use "flow_type" to color boxes by the direction of the flow.

size

default = 0.0. Line width of the box boundary lines.

alpha

Transparency level of the boxes. Understands numbers between 0 and 1.

linetype

Int or String. Type of the box boundary lines. Codes and names: 0 = "blank", 1 = "solid", 2 = "dashed", 3 = "dotted", 4 = "dotdash", 5 = "longdash", 6 = "twodash". For more info see: aesthetics.html#line-types.

width

default = 0.9. Width of the boxes. Typically range between 0 and 1. Values that are greater than 1 lead to overlapping of the boxes.

showLegend

default = false. true - show the legend.

relativeTooltips

Result of the call to the layerTooltips() function. Tooltips for boxes with relative values. Specifies appearance, style and content. When "none", tooltips are not shown. When "detailed", a more detailed (compared to the default) version of the tooltips is shown.

absoluteTooltips

Result of the call to the layerTooltips() function. Tooltips for boxes with absolute values. Specifies appearance, style and content. When "none", tooltips are not shown. When "detailed", a more detailed (compared to the default) version of the tooltips is shown.

sortedValue

default = false. Sorts categories by absolute value of the changes.

threshold

Groups all categories under a certain threshold value into "Other" category.

maxValues

Groups all categories with the smallest changes, except the first maxValues, into "Other" category.

calcTotal

default = true. Setting the calcTotal to true will put the final cumulative sum into a new separate box. Taken into account only if the "measure" column isn't provided.

totalTitle

The header of the last box with the final cumulative sum, if "measure" column isn't provided. Also used as a title in the legend for columns of type "total".

hline

Horizontal line passing through 0. Set "blank" or result of elementBlank() to draw nothing. Set elementLine() to specify parameters.

hlineOntop

default = true. Option to place horizontal line over the other layers.

connector

Line between neighbouring boxes connecting the end of the previous box and the beginning of the next box. Set "blank" or result of elementBlank() to draw nothing. Set elementLine() to specify parameters.

label

Label on the box. Shows change value. Set "blank" or result of elementBlank() to draw nothing. Set elementText() to specify parameters. Use "flow_type" for color parameter of the elementText() to color labels by the direction of the flow.

labelFormat

Format used to transform label mapping values to a string. For more info see: formats.html Note: the "$" must be escaped as "\$".

Examples:

  • ".2f" -> "12.45"

  • "Score: {.2f}" -> "Score: 12.45"

  • "Score: {}" -> "Score: 12.454789"