> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chart Extraction

> Extract structured data from charts and graphs

Reducto can extract numerical data from visualizations and output it as structured tables. This page covers how to configure chart extraction and what chart types are supported.

<Note>
  r-1 is currently in preview and is the default for all new Parse pipelines. It generates short figure descriptions natively. Existing legacy pipelines can continue using legacy figure summarization and promptless figure processing.
</Note>

## Chart Processing with r-1

r-1 offers three ways to process figures and charts:

| Level          | Configuration                                       | What it does                                                         |
| -------------- | --------------------------------------------------- | -------------------------------------------------------------------- |
| **Native**     | No additional configuration                         | Generates a short description for each figure in the full-page pass  |
| **Customized** | `{"scope": "figure", "prompt": "..."}`              | Uses your instructions to produce a use-case-specific interpretation |
| **Advanced**   | `{"scope": "figure", "advanced_chart_agent": True}` | Multi-stage pipeline for precise numerical extraction                |

Customized and advanced chart processing run additional model steps and add latency. They do not add cost to r-1 processing.

## Native Figure Descriptions

r-1 detects figures and generates a short description as part of the same full-page pass. You do not need to configure `summarize_figures` or add a promptless figure scope.

**Output example:** `"Bar chart showing Q1-Q4 revenue growth, with Q4 reaching approximately $2.5M"`

Native descriptions make figures searchable in RAG applications. Use customized or advanced processing when you need a more specific result.

## Customized Figure Processing

Add one figure-scoped custom prompt when your workflow needs a use-case-specific interpretation:

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      enhance={
          "agentic": [
              {
                  "scope": "figure",
                  "prompt": "Describe the relationships between components in this diagram."
              }
          ]
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    enhance: {
      agentic: [
        {
          scope: 'figure',
          prompt: 'Describe the relationships between components in this diagram.'
        }
      ]
    }
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "enhance": {
        "agentic": [
          {
            "scope": "figure",
            "prompt": "Describe the relationships between components in this diagram."
          }
        ]
      }
    }'
  ```
</CodeGroup>

## Advanced: Chart Agent Pipeline

For precise numerical extraction, enable `advanced_chart_agent`. Reducto runs the separate chart extraction agent and augments the r-1 result:

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      enhance={
          "agentic": [{"scope": "figure", "advanced_chart_agent": True}]
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    enhance: {
      agentic: [{ scope: 'figure', advanced_chart_agent: true }]
    }
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "enhance": {
        "agentic": [{"scope": "figure", "advanced_chart_agent": true}]
      }
    }'
  ```
</CodeGroup>

### How the Pipeline Works

The chart agent runs multiple parallel tasks, then combines results:

**Stage 1: Parallel extraction**

* **Component detection**: Identifies each data series (lines, bars, areas, scatter points) and their colors/styles
* **OCR**: Detects all text (axis labels, titles, legends, tick values)
* **Legend detection**: Maps colors to series labels
* **Coordinate extraction**: Finds axis boundaries and tick positions

**Stage 2: Processing**

* **Masking**: Isolates each component by color/style for individual processing
* **Axis functions**: Builds mathematical functions to convert pixel coordinates to actual values (handles linear, logarithmic, and time series axes)
* **Tick alignment**: Maps detected points to axis tick values

**Stage 3: Value extraction**

* Converts pixel coordinates to actual (x, y) values using the axis functions
* Falls back to a VLM for components that couldn't be processed deterministically
* Outputs a consolidated markdown table

### Output Format

Data is returned as a markdown table with the X-axis as rows and each component as a column:

```markdown theme={null}
| Date | Revenue ($M) | Expenses ($M) |
| --- | --- | --- |
| 2020-01 | 125.4 | 98.2 |
| 2020-02 | 142.8 | 105.1 |
| 2020-03 | 168.5 | 112.7 |
```

For bar charts, values show the range: `(bottom, top)`.

## Supported Chart Types

| Chart Type              | Support Level | Notes                                             |
| ----------------------- | ------------- | ------------------------------------------------- |
| **Vertical bar charts** | ✅ Full        | Detects bar heights and x-axis categories         |
| **Line charts**         | ✅ Full        | Tracks points along each series                   |
| **Area charts**         | ✅ Full        | Extracts top/bottom boundaries                    |
| **Scatter plots**       | ✅ Partial     | Works for sparse plots; very dense plots may fail |
| **Combination charts**  | ✅ Full        | Handles mixed bar/line/area in same chart         |
| **Time series**         | ✅ Full        | Supports YYYY, YYYY-MM, YYYY-MM-DD formats        |
| **Logarithmic axes**    | ✅ Full        | Correctly interprets log-scale values             |
| **Dual Y-axis**         | ✅ Full        | Maps components to primary or secondary axis      |

### Not Supported

The advanced pipeline will skip these chart types (falls back to VLM description):

* **Horizontal bar charts**: Axis orientation not supported
* **Pie charts**: No coordinate-based extraction possible
* **Radar/spider charts**: Non-Cartesian coordinate system
* **Density plots**: Continuous distributions don't map to discrete points
* **Flow charts/diagrams**: Not data visualizations
* **Multiple charts in one image**: Requires a single chart per figure
* **Charts with data labels**: If values are already printed on each point, extraction is skipped (the data is already visible)

## Combining with Other Scopes

You can combine advanced chart extraction with custom prompts for other content types. For example, this request applies domain-specific instructions to tables and extracts structured numerical data from charts:

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      enhance={
          "agentic": [
              {
                  "scope": "table",
                  "prompt": "Preserve domain-specific notation such as <0.01, ±, and N/A exactly as written."
              },
              {"scope": "figure", "advanced_chart_agent": True}
          ]
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    enhance: {
      agentic: [
        {
          scope: 'table',
          prompt: 'Preserve domain-specific notation such as <0.01, ±, and N/A exactly as written.'
        },
        { scope: 'figure', advanced_chart_agent: true }
      ]
    }
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "enhance": {
        "agentic": [
          {
            "scope": "table",
            "prompt": "Preserve domain-specific notation such as <0.01, ±, and N/A exactly as written."
          },
          {"scope": "figure", "advanced_chart_agent": true}
        ]
      }
    }'
  ```
</CodeGroup>

## Legacy Figure Processing

Existing legacy Parse pipelines can continue using the previous figure settings:

| Configuration                                       | Legacy behavior                                                                             |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `summarize_figures: true`                           | Uses a separate model to generate a generic figure description. This is enabled by default. |
| `{"scope": "figure"}`                               | Adds enhanced promptless figure processing. `summarize_figures` must also be enabled.       |
| `{"scope": "figure", "advanced_chart_agent": true}` | Runs the multi-stage chart extraction pipeline.                                             |

When migrating to r-1, remove `summarize_figures` and promptless figure scopes. r-1 generates figure descriptions natively. Keep `advanced_chart_agent` when you need structured numerical data from charts.

## Limitations

* **Resolution matters**: Higher quality source images produce more accurate extractions
* **Processing time**: The advanced pipeline is significantly slower than native figure processing. For async calls, use `priority=True` to speed up processing.
* **Dense charts**: Scatter plots with many overlapping points may have reduced accuracy
* **Same-color styles**: Charts where solid and dashed lines share the same color can confuse component detection
