Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Class

go.Funnel

go.Funnel is a Plotly graph-object trace for displaying process stages as length-encoded bars. It supports both part-to-whole and drop-off funnel representations.

How it works

go.Funnel creates a length-encoded funnel trace from ordered stages and their values. Supply stage labels through y and corresponding measurements through x; optional trace attributes control text, orientation, grouping, and appearance.

Syntax

go.Funnel(arg=None, alignmentgroup=None, cliponaxis=None, connector=None, customdata=None, customdatasrc=None, dx=None, dy=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, ids=None, idssrc=None, legend=None, legendgroup=None, legendgrouptitle=None, legendrank=None, legendwidth=None, meta=None, metasrc=None, name=None, offsetgroup=None, opacity=None, orientation=None, outsidetextfont=None, selectedpoints=None, showlegend=None, stream=None, text=None, textfont=None, textinfo=None, textposition=None, texttemplate=None, uid=None, uirevision=None, values=None, value=None, visible=None, width=None, x=None, xaxis=None, xsrc=None, y=None, yaxis=None, ysrc=None)

Returns

A Funnel trace object.

Key points

  • The trace encodes process stages by bar length.
  • A part-to-whole funnel assigns each item to one stage.
  • A drop-off funnel repeats an item across every stage it passed through.
  • go.Funnel is added as a trace to a Plotly figure.

Common mistakes

  • Choose the representation deliberately: a funnel can show each item in one stage or show drop-off across every stage traversed.
  • Use funnelarea instead when an area-based funnel visualization better matches the data.

Example: Basic funnel trace

import plotly.graph_objects as go

fig = go.Figure(go.Funnel(
    y=["Website visit", "Downloads", "Potential customers", "Invoice sent"],
    x=[39, 27.4, 20.6, 11],
    textinfo="value+percent initial"
))
fig.show()

Creates a funnel trace with stage labels on the y-axis, stage values on the x-axis, and annotations showing each value plus its percentage of the initial stage.

When to use it

Show progressive customer or user drop-off

Conversion analysis

Assign items to distinct process stages

Part-to-whole reporting

Compare stage volumes across groups

Process monitoring

Interview questions

QWhat does go.Funnel represent?

go.Funnel is a graph-object trace for visualizing process stages with length-encoded bars. A typical trace maps stage names to y and measurements to x, then places it in a go.Figure.

Follow-up: How can the displayed annotations be configured? Set attributes such as textinfo, textposition, or texttemplate on the trace.

QWhat are the two principal funnel representations?

The trace supports both part-to-whole and drop-off interpretations. In the first, an item appears in one stage; in the second, it appears in each stage it traversed.

Follow-up: When would another trace type be preferable? Use funnelarea when an area-based representation is more suitable.

QWhich arrays define a basic funnel?

Use x for the numeric stage values and y for the ordered stage labels in the standard vertical example. The resulting trace can be passed directly to go.Figure.

Follow-up: How could multiple groups be represented? Add multiple funnel traces, each with its own name, stage labels, and values.

  • plotly.graph_objects.Funnel
  • plotly.graph_objects.funnel.Connector
  • plotly.graph_objects.Funnelarea

Source: Plotly figurewidget overview in Python. Checked 2026-10-15.