Skip to content

Funnel

Overview

The funnel trace type is used to create funnel charts, which visualize data across stages in a process. Funnel charts are often used in sales or marketing to show how data decreases as it passes through each stage (e.g., from leads to closed deals).

You can control the orientation, marker styles, and colors to better represent your data flow. Funnel charts help in identifying bottlenecks or drop-off points in a process.

Common Uses

  • Sales Funnels: Tracking the stages from lead generation to closing a deal.
  • Conversion Funnels: Visualizing the steps in a user journey and where drop-offs occur.
  • Progression Through Stages: Representing data at different stages of a sequential process.

Check out the Attributes for the full set of configuration options

Examples

Common Configurations

Here's a simple funnel chart showing data as it moves through various stages:

You can copy this code below to create this chart in your project:

models:
  - name: funnel-data
    args:
      - echo
      - |
        stage,value
        Leads,1000
        Qualified Leads,750
        Opportunities,400
        Proposals,200
        Closed Deals,100
traces:
  - name: Simple Funnel Plot
    model: ${ref(funnel-data)}
    props:
      type: funnel
      y: ?{stage}
      x: ?{value}
      textinfo: "value+percent previous"
      marker:
        color: "#17becf"
    order_by: 
      - ?{value desc}
charts:
  - name: Simple Funnel Chart
    traces:
      - ${ref(Simple Funnel Plot)}
    layout:
      title:
        text: Simple Funnel Chart<br><sub>Sales Funnel from Leads to Closed Deals</sub>
      xaxis:
        title:
          text: "Stage"
      margin: 
        l: 100

This example demonstrates a horizontal funnel chart, with stages represented along the x-axis:

Here's the code:

models:
  - name: funnel-data-horizontal
    args:
      - echo
      - |
        stage,value
        Awareness,5000
        Interest,3000
        Consideration,1500
        Conversion,700
traces:
  - name: Horizontal Funnel Chart Trace
    model: ${ref(funnel-data-horizontal)}
    props:
      type: funnel
      orientation: v
      x: ?{stage}
      y: ?{value}
      marker:
        color: "#ff7f0e"
    order_by: 
      - ?{value desc}
charts:
  - name: Horizontal Funnel Chart
    traces:
      - ${ref(Horizontal Funnel Chart Trace)}
    layout:
      title:
        text: Horizontal Funnel Chart<br><sub>Stages of User Journey</sub>
      xaxis:
        title:
          text: "Stage"

Here's a funnel chart where each stage has a different color to highlight distinct phases in the process:

You can copy this code below to create this chart in your project:

models:
  - name: funnel-data-custom
    args:
      - echo
      - |
        stage,value,color
        Leads,1200,"#1f77b4"
        MQL,900,"#ff7f0e"
        SQL,600,"#2ca02c"
        Proposal,300,"#d62728"
        Won,100,"#9467bd"
traces:
  - name: Custom Markers Funnel Chart
    model: ${ref(funnel-data-custom)}
    props:
      type: funnel
      y: ?{stage}
      x: ?{value}
      marker:
        color: ?{color}
      textinfo: "value+percent"
      orientation: h
    order_by: 
      - ?{value desc}
charts:
  - name: Funnel Chart with Custom Markers
    traces:
      - ${ref(Custom Markers Funnel Chart)}
    layout:
      title:
        text: Funnel Chart with Custom Markers<br><sub>Stages of the Sales Funnel</sub>
      xaxis:
        title:
          text: "Stage"

This example demonstrates a funnel chart using cohorts to compare the customer journey across different products:

Here's the code:

models:
  - name: funnel-data-cohorts
    args:
      - echo
      - |
        stage,value,product
        Awareness,5000,Product A
        Interest,3000,Product A
        Consideration,1500,Product A
        Purchase,700,Product A
        Awareness,4500,Product B
        Interest,2800,Product B
        Consideration,1200,Product B
        Purchase,500,Product B
        Awareness,3800,Product C
        Interest,2200,Product C
        Consideration,900,Product C
        Purchase,300,Product C
traces:
  - name: Cohort Funnel Chart
    model: ${ref(funnel-data-cohorts)}
    cohort_on: product
    props:
      type: funnel
      y: ?{stage}
      x: ?{value}
      textinfo: "value+percent previous"
      marker:
        colorscale: "Viridis"
    order_by: 
      - ?{ product }
      - ?{ value desc}
charts:
  - name: Funnel Chart with Cohorts
    traces:
      - ${ref(Cohort Funnel Chart)}
    layout:
      title:
        text: Funnel Chart with Cohorts<br><sub>Customer Journey by Product</sub>
      margin: 
        l: 100

This example uses the cohort_on attribute to create separate funnel charts for each product, allowing for easy comparison of the customer journey across different products.

A schema to validate plotly trace properties

Attributes

These attributes apply to traces where trace.props.type is set to funnel. You would configure these attributes on the trace with the trace.props object.

alignmentgroup: 'string' #(1)!
cliponaxis: boolean
connector:
  fillcolor: any
  line:
    color: any
    dash: 'string' #(2)!
    width: number
  visible: boolean
constraintext: any
customdata: array
customdatasrc: 'string' #(3)!
dx: number
dy: number
hoverinfo: array
hoverinfosrc: 'string' #(4)!
hoverlabel:
  align: array
  alignsrc: 'string' #(5)!
  bgcolor: array
  bgcolorsrc: 'string' #(6)!
  bordercolor: array
  bordercolorsrc: 'string' #(7)!
  font:
    color: array
    colorsrc: 'string' #(8)!
    family: 'string | array' #(9)!
    familysrc: 'string' #(10)!
    lineposition: array
    linepositionsrc: 'string' #(11)!
    shadow: 'string | array' #(12)!
    shadowsrc: 'string' #(13)!
    size: array
    sizesrc: 'string' #(14)!
    style: array
    stylesrc: 'string' #(15)!
    textcase: array
    textcasesrc: 'string' #(16)!
    variant: array
    variantsrc: 'string' #(17)!
    weight: array
    weightsrc: 'string' #(18)!
  namelength: array
  namelengthsrc: 'string' #(19)!
hovertemplate: 'string | array' #(20)!
hovertemplatesrc: 'string' #(21)!
hovertext: 'string | array' #(22)!
hovertextsrc: 'string' #(23)!
ids: array
idssrc: 'string' #(24)!
insidetextanchor: any
insidetextfont:
  color: array
  colorsrc: 'string' #(25)!
  family: 'string | array' #(26)!
  familysrc: 'string' #(27)!
  lineposition: array
  linepositionsrc: 'string' #(28)!
  shadow: 'string | array' #(29)!
  shadowsrc: 'string' #(30)!
  size: array
  sizesrc: 'string' #(31)!
  style: array
  stylesrc: 'string' #(32)!
  textcase: array
  textcasesrc: 'string' #(33)!
  variant: array
  variantsrc: 'string' #(34)!
  weight: array
  weightsrc: 'string' #(35)!
legend: string
legendgroup: 'string' #(36)!
legendgrouptitle:
  font:
    color: any
    family: 'string' #(37)!
    lineposition: any
    shadow: 'string' #(38)!
    size: number
    style: any
    textcase: any
    variant: any
    weight: integer
  text: 'string' #(39)!
legendrank: number
legendwidth: number
marker:
  autocolorscale: boolean
  cauto: boolean
  cmax: number
  cmid: number
  cmin: number
  color: array
  coloraxis: string
  colorbar:
    bgcolor: any
    bordercolor: any
    borderwidth: number
    exponentformat: any
    len: number
    lenmode: any
    minexponent: number
    nticks: integer
    orientation: any
    outlinecolor: any
    outlinewidth: number
    separatethousands: boolean
    showexponent: any
    showticklabels: boolean
    showtickprefix: any
    showticksuffix: any
    thickness: number
    thicknessmode: any
    tickangle: number
    tickcolor: any
    tickfont:
      color: any
      family: 'string' #(40)!
      lineposition: any
      shadow: 'string' #(41)!
      size: number
      style: any
      textcase: any
      variant: any
      weight: integer
    tickformat: 'string' #(42)!
    tickformatstops: array
    ticklabeloverflow: any
    ticklabelposition: any
    ticklabelstep: integer
    ticklen: number
    tickmode: any
    tickprefix: 'string' #(43)!
    ticks: any
    ticksuffix: 'string' #(44)!
    ticktext: array
    ticktextsrc: 'string' #(45)!
    tickvals: array
    tickvalssrc: 'string' #(46)!
    tickwidth: number
    title:
      font:
        color: any
        family: 'string' #(47)!
        lineposition: any
        shadow: 'string' #(48)!
        size: number
        style: any
        textcase: any
        variant: any
        weight: integer
      side: any
      text: 'string' #(49)!
    x: number
    xanchor: any
    xpad: number
    xref: any
    y: number
    yanchor: any
    ypad: number
    yref: any
  colorscale: any
  colorsrc: 'string' #(50)!
  line:
    autocolorscale: boolean
    cauto: boolean
    cmax: number
    cmid: number
    cmin: number
    color: array
    coloraxis: string
    colorscale: any
    colorsrc: 'string' #(51)!
    reversescale: boolean
    width: array
    widthsrc: 'string' #(52)!
  opacity: array
  opacitysrc: 'string' #(53)!
  reversescale: boolean
  showscale: boolean
metasrc: 'string' #(54)!
name: 'string' #(55)!
offset: number
offsetgroup: 'string' #(56)!
opacity: number
orientation: any
outsidetextfont:
  color: array
  colorsrc: 'string' #(57)!
  family: 'string | array' #(58)!
  familysrc: 'string' #(59)!
  lineposition: array
  linepositionsrc: 'string' #(60)!
  shadow: 'string | array' #(61)!
  shadowsrc: 'string' #(62)!
  size: array
  sizesrc: 'string' #(63)!
  style: array
  stylesrc: 'string' #(64)!
  textcase: array
  textcasesrc: 'string' #(65)!
  variant: array
  variantsrc: 'string' #(66)!
  weight: array
  weightsrc: 'string' #(67)!
showlegend: boolean
stream:
  maxpoints: number
  token: 'string' #(68)!
text: 'string | array' #(69)!
textangle: number
textfont:
  color: array
  colorsrc: 'string' #(70)!
  family: 'string | array' #(71)!
  familysrc: 'string' #(72)!
  lineposition: array
  linepositionsrc: 'string' #(73)!
  shadow: 'string | array' #(74)!
  shadowsrc: 'string' #(75)!
  size: array
  sizesrc: 'string' #(76)!
  style: array
  stylesrc: 'string' #(77)!
  textcase: array
  textcasesrc: 'string' #(78)!
  variant: array
  variantsrc: 'string' #(79)!
  weight: array
  weightsrc: 'string' #(80)!
textinfo: any
textposition: array
textpositionsrc: 'string' #(81)!
textsrc: 'string' #(82)!
texttemplate: 'string | array' #(83)!
texttemplatesrc: 'string' #(84)!
type: funnel
uid: 'string' #(85)!
visible: any
width: number
x: array
xaxis: string
xhoverformat: 'string' #(86)!
xperiodalignment: any
xsrc: 'string' #(87)!
y: array
yaxis: string
yhoverformat: 'string' #(88)!
yperiodalignment: any
ysrc: 'string' #(89)!
zorder: integer
  1. Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
  2. Sets the dash style of lines. Set to a dash type string (solid, dot, dash, longdash, dashdot, or longdashdot) or a dash length list in px (eg 5px,10px,2px,2px).
  3. Sets the source reference on Chart Studio Cloud for customdata.
  4. Sets the source reference on Chart Studio Cloud for hoverinfo.
  5. Sets the source reference on Chart Studio Cloud for align.
  6. Sets the source reference on Chart Studio Cloud for bgcolor.
  7. Sets the source reference on Chart Studio Cloud for bordercolor.
  8. Sets the source reference on Chart Studio Cloud for color.
  9. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  10. Sets the source reference on Chart Studio Cloud for family.
  11. Sets the source reference on Chart Studio Cloud for lineposition.
  12. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  13. Sets the source reference on Chart Studio Cloud for shadow.
  14. Sets the source reference on Chart Studio Cloud for size.
  15. Sets the source reference on Chart Studio Cloud for style.
  16. Sets the source reference on Chart Studio Cloud for textcase.
  17. Sets the source reference on Chart Studio Cloud for variant.
  18. Sets the source reference on Chart Studio Cloud for weight.
  19. Sets the source reference on Chart Studio Cloud for namelength.
  20. Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%xother}, {%_xother}, {%xother_}. When showing info for several points, xother will be added to those with different x positions from the first point. An underscore before or after (x|y)other will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Finally, the template string has access to variables percentInitial, percentPrevious and percentTotal. Anything contained in tag <extra> is displayed in the secondary box, for example "{fullData.name}". To hide the secondary box completely, use an empty tag <extra></extra>.
  21. Sets the source reference on Chart Studio Cloud for hovertemplate.
  22. Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace hoverinfo must contain a text flag.
  23. Sets the source reference on Chart Studio Cloud for hovertext.
  24. Sets the source reference on Chart Studio Cloud for ids.
  25. Sets the source reference on Chart Studio Cloud for color.
  26. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  27. Sets the source reference on Chart Studio Cloud for family.
  28. Sets the source reference on Chart Studio Cloud for lineposition.
  29. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  30. Sets the source reference on Chart Studio Cloud for shadow.
  31. Sets the source reference on Chart Studio Cloud for size.
  32. Sets the source reference on Chart Studio Cloud for style.
  33. Sets the source reference on Chart Studio Cloud for textcase.
  34. Sets the source reference on Chart Studio Cloud for variant.
  35. Sets the source reference on Chart Studio Cloud for weight.
  36. Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items.
  37. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  38. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  39. Sets the title of the legend group.
  40. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  41. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  42. Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46
  43. Sets a tick label prefix.
  44. Sets a tick label suffix.
  45. Sets the source reference on Chart Studio Cloud for ticktext.
  46. Sets the source reference on Chart Studio Cloud for tickvals.
  47. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  48. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  49. Sets the title of the color bar.
  50. Sets the source reference on Chart Studio Cloud for color.
  51. Sets the source reference on Chart Studio Cloud for color.
  52. Sets the source reference on Chart Studio Cloud for width.
  53. Sets the source reference on Chart Studio Cloud for opacity.
  54. Sets the source reference on Chart Studio Cloud for meta.
  55. Sets the trace name. The trace name appears as the legend item and on hover.
  56. Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
  57. Sets the source reference on Chart Studio Cloud for color.
  58. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  59. Sets the source reference on Chart Studio Cloud for family.
  60. Sets the source reference on Chart Studio Cloud for lineposition.
  61. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  62. Sets the source reference on Chart Studio Cloud for shadow.
  63. Sets the source reference on Chart Studio Cloud for size.
  64. Sets the source reference on Chart Studio Cloud for style.
  65. Sets the source reference on Chart Studio Cloud for textcase.
  66. Sets the source reference on Chart Studio Cloud for variant.
  67. Sets the source reference on Chart Studio Cloud for weight.
  68. The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
  69. Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace hoverinfo contains a text flag and hovertext is not set, these elements will be seen in the hover labels.
  70. Sets the source reference on Chart Studio Cloud for color.
  71. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  72. Sets the source reference on Chart Studio Cloud for family.
  73. Sets the source reference on Chart Studio Cloud for lineposition.
  74. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  75. Sets the source reference on Chart Studio Cloud for shadow.
  76. Sets the source reference on Chart Studio Cloud for size.
  77. Sets the source reference on Chart Studio Cloud for style.
  78. Sets the source reference on Chart Studio Cloud for textcase.
  79. Sets the source reference on Chart Studio Cloud for variant.
  80. Sets the source reference on Chart Studio Cloud for weight.
  81. Sets the source reference on Chart Studio Cloud for textposition.
  82. Sets the source reference on Chart Studio Cloud for text.
  83. Template string used for rendering the information text that appear on points. Note that this will override textinfo. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Finally, the template string has access to variables percentInitial, percentPrevious, percentTotal, label and value.
  84. Sets the source reference on Chart Studio Cloud for texttemplate.
  85. Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
  86. Sets the hover text formatting rulefor x using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46By default the values are formatted using xaxis.hoverformat.
  87. Sets the source reference on Chart Studio Cloud for x.
  88. Sets the hover text formatting rulefor y using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46By default the values are formatted using yaxis.hoverformat.
  89. Sets the source reference on Chart Studio Cloud for y.