rAmCharts - amFunnel

Parameters

  • data: a dataframe with at least 2 columns: value (numeric, positive), and description (character). See data_funnel for example. You can add a third column “color” (character, colors in hexadecimal) to specify the colors.
  • neck_height: a numeric, value between 0 and 100 : if a bottleneck is desired, this value determines its heigh. Default to NULL.
  • neck_width: a numeric, value between 0 and 100 : if a bottleneck is desired, this value determines its width. Default to NULL.
  • depth: a numeric, between 0 and 100. If superior to 0, chart is displayed in 3D. Only for pyramid chart (without a bottleneck).
  • inverse: a boolean, if TRUE, the funnel chart will be inversed.
  • label_side: a character, defines the label position : “right” or “left”.
  • margin_right: a numeric, margin at the right side.
  • margin_left: a numeric, margin at the left side.
  • : other parameters called in amOptions.

Data used in the examples:

data("data_funnel")
head(data_funnel)
##              description value
## 1         Website visits   300
## 2              Downloads   123
## 3   Requested price list    98
## 4 Contaced for more info    72
## 5              Purchased    80
## 6  Contacted for support    15

Reference example : Pyramid chart

amFunnel(data = data_funnel, inverse = TRUE)

Reference example : Funnel chart

amFunnel(data = data_funnel, neck_height = 30, neck_width = 40)

Inversed Pyramid chart

amFunnel(data = data_funnel, inverse = FALSE)

Change label side

amFunnel(data = data_funnel, inverse = FALSE, label_side = "left")

3D pyramid

amFunnel(data = data_funnel, depth = 50, inverse = TRUE)

amOptions

export

amFunnel(data = data_funnel, inverse = FALSE, export = TRUE)
#or
amFunnel(data = data_funnel, inverse = FALSE) %>>% 
  amOptions(export = TRUE)

exportFormat

amFunnel(data = data_funnel, inverse = FALSE, export = TRUE, exportFormat = "JPG")
#or
amFunnel(data = data_funnel, inverse = FALSE) %>>% 
  amOptions(export = TRUE, exportFormat = "JPG")

main and creditsPosition

amFunnel(data = data_funnel, inverse = FALSE, main = "My Pyramid",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "bottom-left")
#or
amFunnel(data = data_funnel, inverse = FALSE) %>>% 
  amOptions( main = "My Pyramid",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "bottom-left")

theme

amFunnel(data = data_funnel, inverse = FALSE, theme = "patterns")
#or
amFunnel(data = data_funnel, inverse = FALSE) %>>% 
  amOptions(theme = "patterns")