Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Funnel chart

Since 0.1.0-alpha.22
Shows how many make it through each step of a checkout, a sign-up or a sales pipeline, and where the most are lost.

Use a funnel for a fixed sequence of steps, each a subset of the one before, such as a checkout. It works best with four or more steps. When the exact numbers matter, use bars in step order. Values that just get smaller, such as sales by region, aren't a funnel.

Stages and their shares

Give FunnelChart the Items in the order of the process, each stage's name as Argument, its count as Value, and a Title.

Static

Preview

Trial sign-ups, October
  1. Viewed pricing, 12,400
  2. Started sign-up, 7,900, 64% of the first, 64% of the stage before
  3. Created an account, 5,600, 45% of the first, 71% of the stage before
  4. Started a trial, 3,700, 30% of the first, 66% of the stage before
  5. Became a customer, 1,450, 12% of the first, 39% of the stage before

Code

Usage.razor
@* A month's trial sign-ups, from the pricing page to a paid plan. *@
<FunnelChart Items="_stages" Argument="s => s.Stage" Value="s => s.People" Title="Trial sign-ups, October" />

@code {
    private record SignupStage(string Stage, int People);

    private readonly SignupStage[] _stages =
    [
        new("Viewed pricing", 12_400),
        new("Started sign-up", 7_900),
        new("Created an account", 5_600),
        new("Started a trial", 3_700),
        new("Became a customer", 1_450),
    ];
}

Add this example to a page with the izzy CLI:

bash
izzy add component FunnelChart --at <file>:<line>

Each stage's label gives its name, value and share of the first stage. "Show data" adds each stage's share of the one before.

Labels in the stages

To write each stage's label in it, as its share over its name, set Labels="ChartLabels.Inside". A label that doesn't fit its stage, such as a narrow last stage's, sits beside the shape with a line instead.

Static

Preview

Sales pipeline, Q3
  1. Leads, 1,840
  2. Qualified, 1,290, 70% of the first, 70% of the stage before
  3. Proposal sent, 760, 41% of the first, 59% of the stage before
  4. Negotiating, 410, 22% of the first, 54% of the stage before
  5. Won, 180, 10% of the first, 44% of the stage before

Code

Inside.razor
@* A quarter's sales pipeline, each stage's share written in it; the last stage is too narrow, so its label sits beside. *@
<FunnelChart Items="_stages" Argument="s => s.Stage" Value="s => s.Deals" Title="Sales pipeline, Q3" Labels="ChartLabels.Inside" />

@code {
    private record PipelineStage(string Stage, int Deals);

    private readonly PipelineStage[] _stages =
    [
        new("Leads", 1_840),
        new("Qualified", 1_290),
        new("Proposal sent", 760),
        new("Negotiating", 410),
        new("Won", 180),
    ];
}

LabelTemplate replaces the labels with your own, inside or beside, built from each stage's Name, ValueText, Share and ShareOfPrevious. ChartLabels.None leaves the labels out.

A pyramid

A pyramid shows levels of a hierarchy, such as a team by seniority. To draw one, set Pyramid: the first item is at the bottom, and each level is as tall as its share of the total, which its label shows.

Static

Preview

Engineering team by level
  1. Engineer, 64, 52% of the total
  2. Senior engineer, 41, 33% of the total
  3. Staff engineer, 14, 11% of the total
  4. Principal engineer, 5, 4.0% of the total

Code

Pyramid.razor
@* An engineering team by level, the most junior as the base. *@
<FunnelChart Items="_levels" Argument="l => l.Level" Value="l => l.People" Title="Engineering team by level" Pyramid />

@code {
    private record TeamLevel(string Level, int People);

    private readonly TeamLevel[] _levels =
    [
        new("Engineer", 64),
        new("Senior engineer", 41),
        new("Staff engineer", 14),
        new("Principal engineer", 5),
    ];
}

The wide base gives the first level more area than its share. To compare levels exactly, use a Chart with bars across.

Details

Stages keep the items' order, unsorted: the order is the process. A missing, zero or negative value gets no stage in the shape but keeps its label and its row in the table, and the stage after it has no share of the one before. Each stage has the palette's next color, as a PieChart's slices do.

Mode support

What works in each mode, Funnel chart
FeatureStaticInteractive
A funnel, each stage as wide as its value and sloping to the nextYesYes
A pyramid, each level as tall as its share of the totalYesYes
Each stage named beside the shape with its value and share, joined by a line, or in its stage where it fitsYesYes
Labels you write with a templateYesYes
A table of the values, with each stage's share of the one before, in a "Show data" disclosureYesYes

Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.

Accessibility

  • The chart is a figure captioned by Title, or named by a heading on the page with TitledBy.
  • The labels are a list, named by the title: each reads its name, value, and share of the first and of the stage before (a pyramid's: of the total). The shape is hidden from screen readers.
  • "Show data" under the chart opens the same numbers as a table (DataTable).

Parameters

FunnelChart parameters
PropTypeDefault
RefreshHow often the chart reads its data again, at least a second, such as Refresh="TimeSpan.FromSeconds(30)".TimeSpan?
RefreshFromOn a static page with Refresh: a lighter page to fetch than this one, which renders the same chart with the same id.string?
ChildContentChartDrillLevel<T>s, from the top, for stages that drill down: each level's groups are the stages (the level's argument in place of Argument), their values added up by Aggregate, and selecting one shows the next level.RenderFragment?
DrillWith drill-down levels: the page address's query value that holds the level ("drill" by default; give each chart that drills on a page its own).string?
HideBreadcrumbWith drill-down levels: leaves out the breadcrumb above the chart.boolfalse
AggregateWith drill-down levels, how each stage adds up its items' values: Sum by default, or Avg, Min, Max or Count.DataAggregateDataAggregate.Sum
ItemsThe items, one stage each, in the order of the process.IEnumerable<TItem>?Required
ArgumentEach stage's name, such as s => s.Stage.Expression<Func<TItem, object?>>?
ValueEach stage's value, such as s => s.People: any number.Expression<Func<TItem, object?>>Required
TitleThe chart's title, such as "Sign-ups, October", shown above it as its caption.string?
HideTitleHides the title, which still names the chart for screen readers.boolfalse
DownloadShows a button across from the title that saves the chart as a PNG, named after its title, in the color scheme on screen.boolfalse
TitleAlignWhere the title sits: at the start by default (the left, in a left-to-right page); ChartAlign.Center or ChartAlign.End.ChartAlignChartAlign.Start
TitledByThe id of a heading already on the page that titles the chart, such as a card's, in place of Title: the chart takes its name from it and shows no title of its own.string?
ValueFormatA .NET format string for the values, such as C0 or N0.string?
PaletteThe colors in order: Colors (the theme's eight, the default), Shades of one color, or your own with Of.ChartPalette?
PyramidDraws a pyramid: a triangle on its base, the first item at the bottom, each level as tall as its share of the total, for levels of a hierarchy such as a team's seniority.boolfalse
LabelsWhere the labels go: beside the shape, joined to their stages by lines, by default (Auto or ChartLabels.Outside); ChartLabels.Inside writes each in its stage (its share over its name), where it fits, and puts the rest beside the shape.ChartLabelsChartLabels.Auto
LabelTemplateWrites each label yourself, from the stage's name, value and shares: inside its stage or beside the shape (Inside says which).RenderFragment<FunnelLabelContext<TItem>>?
DataTableThe values as a table: by default behind a "Show data" button that opens it over the chart; ChartDataTable.Collapsed puts it in a disclosure under the chart.ChartDataTableChartDataTable.Popover
OnRefreshOn an interactive page with Refresh: raised at each interval, to load new data.EventCallback

See also

  • Chart: draws a chart on the server from a list of items, with axes, value labels, reference lines, trends and a table of the values, for every chart type.
  • PieChart: shows how one total splits into a few shares, such as customers by plan, each labeled with its share.

Connection lost

Rejoining the server…