# Funnel chart

A funnel chart helps you visualize a linear process that has sequential connected stages. Each funnel stage (that is a horizontal bar) can be used to represent a percentage of the total, or the effective number for that stage.

## The Method To Use <a href="#the-method-to-use" id="the-method-to-use"></a>

The method is `s.plt.funnel()`

It must contain the following input variables:

```python
order: int
names: str
values: str
data: Union[str, DataFrame, List[Dict]]
```

And accepts the following input variables as optional:

```python
title: Optional[str]
rows_size: Optional[int] 
cols_size: Optional[int]
padding: Optional[List[int]]
option_modifications: Optional[Dict]
```

#### Video demonstration of the Funnel chart <a href="#video-demonstration-of-the-funnel-chart" id="video-demonstration-of-the-funnel-chart"></a>

{% embed url="<https://www.loom.com/share/4b31d99c038f4b23a43e592e2cc856e2?sharedAppSource=team_library>" %}

The Funnel chart setting and usage.

## Examples <a href="#examples" id="examples"></a>

### 1. Default Configuration <a href="#id-1.-default-configuration" id="id-1.-default-configuration"></a>

```python
data = [
    {
        "value": 60,
        "name": "Third"
    },
    {
        "value": 40,
        "name": "Fourth"
    },
    {
        "value": 20,
        "name": "Fifth"
    },
    {
        "value": 80,
        "name": "Second"
    },
    {
        "value": 100,
        "name": "First"
    }
]

s.plt.funnel(
    data=data, names='name', values='value', order=0,
)
```

![The funnel chart is in the default configuration.](/files/79T9RI87TUrCPxV6YrKS)

### 2. Customization And Context <a href="#id-2.-title-for-the-chart-and-changing-data" id="id-2.-title-for-the-chart-and-changing-data"></a>

```python
data = [
    {
        "value": 50,
        "name": "Clicked"
    },
    {
        "value": 30,
        "name": "Analysis"
    },
    {
        "value": 60,
        "name": "Negotiations"
    },
    {
        "value": 90,
        "name": "Viewed"
    },
    {
        "value": 100,
        "name": "Prospected"
    },
    {
        "value": 10,
        "name": "Closed Sales"
    },
]

s.plt.funnel(
    data=data, order=0,
    names='name', values='value',
    rows_size=2, cols_size=7,
    padding='0,0,0,2', title='Stage',
)
```

![Note the space before the component using padding='0,0,0,2', and its size with  cols\_size=7.](/files/Q0PNi2JV4NWQ56uuWzxb)

{% hint style="info" %}

### Featured Content

[Changing the Menu Path](/dev/building-web-app/menu/changing-the-menu-path.md)\
The `menu_path` can be modified.<br>

[Using the Grid](/dev/building-web-app/grid/using-the-grid.md)

It is possible to use any number of rows.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shimoku.com/dev/elements/charts/funnel-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
