# Stacked Area

A Stacked Area Chart is an extension of the basic Area Chart, where multiple datasets are layered on top of one another, showcasing the cumulative contribution of each dataset to the total. Each distinct color or shade represents a different data category, allowing for easy visual differentiation. It's particularly useful for displaying the composition and relative proportion of multiple data series over time.

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

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

It must contain the following parameters:

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

and accepts these parameters as optional:

```python
y: Optional[Union[List[str], str]]
x_axis_name: Optional[str]
y_axis_name: Optional[str]
title: Optional[str]
rows_size: Optional[int]
cols_size: Optional[int]
padding: Optional[List[int]]
show_values: Optional[List[str]]
option_modifications: Optional[Dict]
variant: Optional[str]
```

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

The following code:

```python
data = [
    {'Weekday': 'Mon', 'Email': 120, 'Union Ads': 132, 'Video Ads': 101, 'Search Engine': 134},
    {'Weekday': 'Tue', 'Email': 220, 'Union Ads': 182, 'Video Ads': 191, 'Search Engine': 234},
    {'Weekday': 'Wed', 'Email': 150, 'Union Ads': 232, 'Video Ads': 201, 'Search Engine': 154},
    {'Weekday': 'Thu', 'Email': 820, 'Union Ads': 932, 'Video Ads': 901, 'Search Engine': 934},
    {'Weekday': 'Fri', 'Email': 120, 'Union Ads': 132, 'Video Ads': 101, 'Search Engine': 134},
    {'Weekday': 'Sat', 'Email': 220, 'Union Ads': 182, 'Video Ads': 191, 'Search Engine': 234},
    {'Weekday': 'Sun', 'Email': 150, 'Union Ads': 232, 'Video Ads': 201, 'Search Engine': 154},
]

s.plt.stacked_area(
    data=data, x="Weekday", order=0,
    x_axis_name='Visits per weekday',
)
```

<figure><img src="/files/Ml1ix9iR1vmInxA2SdYV" alt=""><figcaption><p>Stacked area chart</p></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="/files/9RY1dCpVAPUKLPzuWAoN" alt=""><figcaption><p>variant="clean"</p></figcaption></figure>
{% endtab %}

{% tab title="Minimal" %}

<figure><img src="/files/5jo80GSJHnmHJbF0B4Hq" alt=""><figcaption><p>variant="minimal"</p></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# 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/area-charts/stacked-area.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.
