Wolfram Research

Function Repository Resource:

FunnelChart (1.0.0) current version: 1.0.1 »

Source Notebook

Create a chart showing diminishing quantities surviving stages of a process

Contributed by: Jon McLoone

ResourceFunction["FunnelChart"][data]

shows a list of the numerical values in data as a funnel.

ResourceFunction["FunnelChart"][<|"lbl1"val1,"lbl2"val2,|>]

shows values vali as a funnel labeled with the lbli.

Details and Options

A funnel chart is typically used to show the survival rate of a multistage process such as sales leads progressing towards a sale.
ResourceFunction["FunnelChart"] accepts the following options:
"EdgeStyle" Black style for the EdgeForm of the funnel
"ProportionTextStyle" Automatic style for appearance element "Proportion"
"SpacingStyle" GrayLevel[0.9] style for transitions between funnel stages
"StepProportionTextStyle" Automatic style for appearance element "StepProportion"
"ValueTextStyle" Automatic style for appearance element "Value"
AppearanceElements None list of text elements to display on each stage
ChartLabels Automatic list of labels for each stage of the funnel
ColorFunction Automatic function giving the color of each funnel stage
InterpolationOrder 1 shape of the funnel stages
Spacings 0.04 space to allow for transitions between stages
The possible element values in AppearanceElements are "Value", "Proportion" and "StepProportion".
The ColorFunction is applied to the position of each stage.
ResourceFunction["FunnelChart"] returns a Graphics object.

Examples

Basic Examples (2) 

Display a funnel chart for a process where 10 items entered the process but only 1 completed it:

In[1]:=
ResourceFunction["FunnelChart"][{10, 7, 3, 1}]
Out[1]=

Funnel charts are often used to describe business processes where there is a loss between stages. For example, sales leads being developed into sales:

In[2]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>]
Out[2]=

Options (7) 

InterpolationOrder controls the shape of the funnel stages. Typical values are 0, 1 or 2:

In[3]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Interested" -> 6, "Negotiated" -> 3, "Won" -> 1|>, InterpolationOrder -> #] & /@ {0, 1, 2}
Out[3]=

Spacings is used to separate the funnel stages:

In[4]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, Spacings -> 0.2]
Out[4]=

Control the style of spacings with "SpacingStyle":

In[5]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, Spacings -> 0.1, "SpacingStyle" -> None]
Out[5]=

AppearanceElements controls which numbers are displayed on the FunnelChart. There are three choices. "Values" displays the raw data:

In[6]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, AppearanceElements -> "Value"]
Out[6]=

"Proportion" displays the data as a proportion of the first value in the funnel:

In[7]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, AppearanceElements -> "Proportion"]
Out[7]=

"StepProportion" displays the data as a proportion of the previous stage of the process:

In[8]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, AppearanceElements -> "StepProportion", Spacings -> 0.15]
Out[8]=

Multiple AppearanceElements can be given as a list or by using the value All:

In[9]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, AppearanceElements -> All, Spacings -> 0.15]
Out[9]=

All text contents are subject to styles given with BaseStyle. AppearanceElements can be individually styled with "ValueTextStyle", "ProportionTextStyle" and "StepProportionTextStyle":

In[10]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>,
 AppearanceElements -> All, Spacings -> 0.15,
 "ValueTextStyle" -> Directive[LightGray, FontSize -> 20], "ProportionTextStyle" -> Directive[White, FontSize -> 20] , "StepProportionTextStyle" -> Directive[Red, FontSize -> 9], BaseStyle -> {30, Gray}]
Out[10]=

Funnel colors can be given with any ColorFunction that accepts integer values from 1 to the number of stages:

In[11]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>, ColorFunction -> ColorData[2], BaseStyle -> 20]
Out[11]=

Properties and Relations (1) 

While it is not the typical usage, it is possible to give use data that is not monotonically decreasing:

In[12]:=
ResourceFunction["FunnelChart", ResourceVersion->"1.0.0"][<|"Leads" -> 5, "Responses" -> 12, "Negotiated" -> 5, "Won" -> 20|>, ColorFunction -> ColorData[2], BaseStyle -> 20]
Out[12]=

Version History

  • 1.0.1 – 15 August 2022
  • 1.0.0 – 24 September 2020

Related Resources

License Information