# Top Bottom Area Charts

Top Bottom Area Charts present two distinct area charts within the same visual space, each operating on its own y-axis. This design facilitates the comparison of datasets with differing scales. The chart effectively juxtaposes two datasets, allowing for clear discernment of patterns or correlations between them, even when they operate on different magnitudes or units.

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

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

It must contain the following input variables:

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

Accepts the following input variables as optional:

```python
top_names: Optional[List[str]] = None, 
bottom_names: Optional[List[str]] = None,
rows_size: int = 4, 
cols_size: Optional[int] = None,
padding: Optional[str] = None, 
title: Optional[str] = None,
x_axis_name: Optional[str] = None, 
top_axis_name: Optional[str] = None,
bottom_axis_name: Optional[str] = None, 
option_modifications: Optional[Dict] = None
```

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

This is the .csv that will be used for the example:The Method To Use

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

It must contain the following input variables:

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

Accepts the following input variables as optional:

```python
top_names: Optional[List[str]] = None, 
bottom_names: Optional[List[str]] = None,
rows_size: int = 4, 
cols_size: Optional[int] = None,
padding: Optional[str] = None, 
title: Optional[str] = None,
x_axis_name: Optional[str] = None, 
top_axis_name: Optional[str] = None,
bottom_axis_name: Optional[str] = None, 
option_modifications: Optional[Dict] = None
```

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

This is the .csv that will be used for the example:

{% file src="<https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FHlOVAcwHpXbRgJxkDlTz%2FRainfall%20and%20flow.csv?alt=media&token=6d2db607-f829-4b6d-a646-79c0fc87a1b3>" %}

The following code:

```python
s.plt.top_bottom_area(
    data=pd.read_csv('Rainfall and flow.csv'), 
    order=0, x='Date',
    top_names=['flow'], bottom_names=['rainfall'],
    title='rainfall and flow', x_axis_name='Date',
    top_axis_name='flow(m³/s)', bottom_axis_name='rainfall(mm)'
)
```

<figure><img src="https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FKZm4K82SQvn73e49s7dD%2FTop%20Bottom%20Area.png?alt=media&#x26;token=89367f8a-a0cc-4bf2-9172-810c96fdbf4e" alt=""><figcaption></figcaption></figure>

## Variants

By setting the parameter `variant` to the following values the appearance of the chart can be changed:

{% tabs %}
{% tab title="Clean" %}

<figure><img src="https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FDOFUqeG33RHrRTQXxCpH%2Fimatge.png?alt=media&#x26;token=9c11e6a3-eb64-43a2-bc89-30088554a9aa" alt=""><figcaption><p>variant="clean"</p></figcaption></figure>
{% endtab %}

{% tab title="Minimal" %}

<figure><img src="https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2F08MjaaY8VWeeb8CXbhDH%2Fimatge.png?alt=media&#x26;token=5f9b1ce3-0f9c-4f15-9051-b0ef65cefe74" alt=""><figcaption><p>variant="minimal"</p></figcaption></figure>
{% endtab %}
{% endtabs %}
