# Dynamic chart

1. Select the shape by `name` you want to modify. See [here](/knowledge-base/finding-shape-names.md) to find shape names.
2. You can add additional series to a chart by specifying new series keys in your payload.
   1. Any newly added series will be created as a copy of the last existing series.
3. If your `template` contains more series than the provided data, the extra series will be automatically removed.
4. Axes that no longer contain any data after this adjustment will also be deleted.

Reference: [chart](/json-template-syntax/shapes/chart.md)

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1_hLWEznVkokPtJRgNs_kSR1_sUcIVDyV) | [output.pptx](https://drive.google.com/uc?export=download\&id=1JNA98ejRIgUEN7X4WGpTNcG9zUneeg-g)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="/files/5nBmzUZKhMsCvy2Tvr5i" alt=""><figcaption></figcaption></figure>

***

<figure><img src="/files/WK3oHMQ6yP5uP4p7R4Z4" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Chart 1",
            "title": "Monthly Revenue in 2024 (in millions)",
            "data": [
              [
                "Revenue"
              ],
              [
                "January", 
                "February", 
                "March", 
                "April", 
                "May", 
                "June"
              ],
              [
                  4.8
              ],
              [
                  5.2
              ],
              [
                  6.1
              ],
              [
                  5.9
              ],
              [
                  7.0
              ],
              [
                  8.3
              ]
            ]
          }
        ]
      }
    ]
  }
}

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}


---

# 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.powerpointgeneratorapi.com/examples/chart/dynamic-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.
