Add native vector chart
add_chartGenerate a single-page PDF with a native vector chart: bar, horizontal bar, line with markers, pie, or donut. Supports multi-series, legends, gridlines, negative values, and tagged PDF with auto alt text.
Instructions
Generate a single-page PDF with a native vector chart (pdfnative v1.6.0): bar, barH (horizontal bar), line (optional markers), pie or donut — rendered as pure PDF path operators, zero rasterisation. Multi-series bar/line, legends, 'nice' 1/2/5×10ⁿ axis ticks, gridlines, negative values, and a tagged-PDF /Figure + /Alt (auto-generated when altText omitted, so PDF/A stays conformant). Pie/donut use exactly one series (each value = a slice). Colours are hex strings (e.g. '#3366cc'). For a chart embedded amongst headings/paragraphs/tables, use a 'chart' block inside generate_basic_pdf instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| axis | No | Value-axis options (bar/line only). | |
| pdfA | No | Optional PDF/A conformance level (powered by pdfnative v1.2). Use 'pdfa1b' for archival of simple text+images, 'pdfa2b'/'pdfa2u' for richer content (2u guarantees Unicode mapping), 'pdfa3b' when embedding source attachments (Factur-X / ZUGFeRD). Mutually exclusive with PDF encryption. See docs/guides/PDFA.md. | |
| align | No | Horizontal alignment within the content width. Default 'left'. | |
| intro | No | Optional introductory paragraph rendered above the chart. The chart `title` (if any) is also used as the PDF metadata title. | |
| title | No | Chart title rendered above the plot. | |
| width | No | Plot width in points (clamped to content width). Default 460. | |
| colors | No | Palette override (per-series for bar/line, per-slice for pie/donut). | |
| height | No | Plot-area height in points. Default 240. | |
| legend | No | Legend placement. Defaults to 'bottom' for multi-series/pie, else 'none'. | |
| series | Yes | Data series. Pie/donut charts use exactly one series (each value becomes a slice). | |
| altText | No | Alt text for the tagged-PDF /Figure /Alt. Auto-generated when omitted. | |
| markers | No | Draw point markers on line series. Default false. | |
| chartType | Yes | Chart kind. 'pie'/'donut' use exactly one series; 'bar'/'barH'/'line' support multiple series. | |
| categories | No | Category / slice labels (x-axis). Defaults to 1-based indices when omitted. | |
| outputMode | No | Either 'base64' (returns the PDF inline) or 'file' (writes into the PDFNATIVE_MCP_OUTPUT_DIR sandbox). | base64 |
| outputPath | No | Required when outputMode='file'. Relative path inside the sandbox; must end with .pdf. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| sizeBytes | Yes |