Funnels
A funnel shows how many make it through each stage of a process, such as visits, product views, cart, checkout and purchase. Each stage is a segment as wide as its share of the largest, narrowing to the next, so the drop between stages is easy to see.
Stages narrowing down
FunnelSeries draws one segment per item, top to bottom in the order of the items: XValue is the stage
and YValue how many reached it. Larger stages are taller as well as wider. Each segment has a palette color of its own and shows its value and its share of
the stage before; the stage names sit in a column on the left, each with a thin line to its segment. A value that does not fit in its segment
goes just after it. The tooltip adds the share of the first stage. DataLabels="false" leaves the values out.
Code
<RioChart Items="shop" Title="Shop funnel, March">
<FunnelSeries Name="Visitors" XValue="s => s.Name" YValue="s => s.Users" Format="#,0" />
</RioChart>From raw events
With Aggregate, items with the same stage are combined into one segment, so a list of events per channel gives the
funnel directly. Stages appear in the order they are first seen. Clicking a stage with Selection on selects the
items behind it. In JSON definitions: "type": "funnel" with "x", "y" and
"aggregate".
Click a stage to select its events.
Code
<RioChart Items="events" Selection="ChartSelectionMode.Points" @bind-SelectedItems="picked">
<FunnelSeries Name="Shoppers" XValue="e => e.Step" YValue="e => e.Count" Aggregate="Aggregate.Sum" />
</RioChart>One color, one stage highlighted
Color on the series draws every stage in that color; ColorValue then gives a stage its own, for
example the step with the largest drop.
Code
<RioChart Items="hiring">
<FunnelSeries Name="Candidates" XValue="s => s.Name" YValue="s => s.Users" Color="--rio-series-1"
ColorValue="@(s => s.Name == "Interview" ? "--rio-negative" : null)" />
</RioChart>