rAmCharts - amWaterfall

Parameters

  • data: a dataframe with at least 3 columns : label (character), value (numeric), operation (character : “plus”, “minus”, “total”). You can add a third column “color” (character, colors in hexadecimal). You can also add a column “description” (character) containing the text you want to display when mouse is on the graphic (‘
    ’ for a new line). See data_xaterfall for example.
  • start: a numeric, value from which to start.
  • horiz: a boolean, TRUE for an horizontal chart, FALSE for a vertical one.
  • show_values: a boolean, TRUE to display values.
  • : other parameters called in amOptions.

Data used in the examples:

data("data_waterfall")
head(data_waterfall)
##        label value operation
## 1   Income 1     5      plus
## 2   Income 2    10      plus
## 3   Income 3    15      plus
## 4    Total 1    30     total
## 5 Expenses 1    10     minus
## 6 Expenses 2     5     minus

Reference example

amWaterfall(data = data_waterfall, labelRotation = -45)

Horizontal waterfall

amWaterfall(data = data_waterfall, horiz = TRUE)

Display values

amWaterfall(data = data_waterfall, show_values = TRUE, labelRotation = -45)

amOptions

export

amWaterfall(data = data_waterfall, export = TRUE, labelRotation = -45)
#or
amWaterfall(data = data_waterfall, labelRotation = -45, export = TRUE) %>>% 
  amOptions(export = TRUE)

exportFormat

amWaterfall(data = data_waterfall, labelRotation = -45, export = TRUE, exportFormat = "JPG")
#or
amWaterfall(data = data_waterfall, labelRotation = -45) %>>% 
  amOptions(export = TRUE, exportFormat = "CSV")

main and creditsPosition

amWaterfall(data = data_waterfall, labelRotation = -45, main = "My Waterfall",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "top-right")
#or
amWaterfall(data = data_waterfall, labelRotation = -45) %>>% 
  amOptions( main = "My Waterfall",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "top-right")

theme

amWaterfall(data = data_waterfall, labelRotation = -45, theme = "patterns")
#or
amWaterfall(data = data_waterfall, labelRotation = -45) %>>% 
  amOptions(theme = "patterns")