Generate chart
generate_chartRender refugee displacement data for one or more countries as a chart specification. Supports line or bar charts in Chart.js, Vega-Lite, Mermaid, or SVG formats, with optional normalization per 1,000 residents or per US$1bn GDP.
Instructions
Render a displacement metric for one or more countries as a chart specification. Formats: "chartjs" (Chart.js v4 config JSON), "vega-lite" (v5 spec), "mermaid" (xychart block), "svg" (standalone image markup). Set normalize_by to plot per 1,000 residents or per US$1bn GDP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Chart type (default line) | |
| role | No | "asylum" = people hosted IN the country; "origin" = people displaced FROM the country | |
| format | Yes | Output format | |
| metric | No | Metric to plot (default refugees) | |
| year_to | No | Last year of the range (default: latest available) | |
| countries | Yes | Countries to plot | |
| year_from | No | First year of the range (default: 10 years back) | |
| normalize_by | No | Normalize values by a denominator: "population" → per 1,000 residents, "gdp" → per US$1bn GDP. Requires the worldbank provider. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | ||
| unit | Yes | ||
| title | Yes | ||
| format | Yes |