Skip to content

Funnel chart ​

Steps that shrink, with the share that remains. Good for conversion rates.

The smallest code that works. change the code, then press Run

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'funnel',
  data: [
    { name: 'Visitors', value: 6585 },
    { name: 'Sign-ups', value: 3424 },
    { name: 'Trials', value: 1438 },
    { name: 'Customers', value: 805 },
  ],
};

export default function Example() {
  return <Chart spec={spec} style={{ height: 340 }} />;
}

Or import this chart alone: what each import weighs.

Options

Beside the fields shared by every chart (title, format, heading, export…), type funnel takes:

interface FunnelSpec extends Base, Clickable {
  type: 'funnel';
  data: Item[];
  /** Share of the first step (default) or of the previous one. */ rate?: 'first' | 'previous' | false;
}

interface Item {
  name: string;

Style it

  • Colours: theme.palette, chart.setColor(name, colour), or --nervure-palette in your CSS. More
  • Marks: [data-series="name"], parts: [data-part="axes"], legend, series. What you change is kept in exports.
  • Movement: animation: false draws at once. More
  • Files: chart.download('png'), svg, csv. More

Close to it