Skip to content

Funnel

funnel() over named columns of a dataframe_mojo DataFrame (#743). Each argument names a column instead of holding the values. The axis titles default to the categories and values column names.

Funnel

Usage

from dataviz import funnel
from dataviz import save
from dataviz import Theme

def main() raises:
    var stages: List[String] = ["Impressions", "Clicks", "Add to Cart", "Orders"]
    var counts: List[Int] = [10000, 3200, 950, 400]

    var c = funnel(stages, counts, title="Customer Conversion Funnel")
    save(c, "docs/src/examples/out_funnel.svg")

See Data shapes for shared input conventions.

Args:

  • df: The frame to read.
  • categories: The string column for this channel.
  • values: The numeric column for this channel.
  • theme: See the list overload.
  • width: See the list overload.
  • height: See the list overload.
  • title: See the list overload.
  • subtitle: See the list overload.
  • x_title: See the list overload.
  • y_title: See the list overload.

Related

Related charts: Bullet · Slope

Relevant API: funnel