Function Repository Resource:

FunnelChart

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"] has the same options as Graphics, with the following additions and changes:
"EdgeStyle"Blackstyle for the EdgeForm of the funnel
"ProportionTextStyle"Automaticstyle for appearance element "Proportion"
"SpacingStyle"GrayLevel[0.9]style for transitions between funnel stages
"StepProportionTextStyle"Automaticstyle for appearance element "StepProportion"
"ValueTextStyle"Automaticstyle for appearance element "Value"
AppearanceElementsNonelist of text elements to display on each stage
ChartLabelsAutomaticlist of labels for each stage of the funnel
ColorFunctionAutomaticfunction giving the color of each funnel stage
InterpolationOrder1shape of the funnel stages
Spacings0.04space 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.

Examples

Basic Examples (1) 

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]=

Scope (2) 

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"][<|"Leads" -> 10, "Responses" -> 7, "Negotiated" -> 3, "Won" -> 1|>]
Out[2]=

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

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

Options (7) 

AppearanceElements (3) 

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

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

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

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

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

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

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

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

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

In[8]:=
ResourceFunction[
 "FunnelChart"][<|"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[8]=

ColorFunction (1) 

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

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

InterpolationOrder (1) 

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

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

Spacings (1) 

Spacings is used to separate the funnel stages:

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

SpacingStyle (1) 

Control the style of spacings with "SpacingStyle":

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

Publisher

Jon McLoone

Version History

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

Related Resources

License Information