create_chart
Build Datawrapper charts with detailed customization. Pass data in JSON, select a chart type, and control all visual properties through a Pydantic configuration.
Instructions
⚠️ THIS IS THE DATAWRAPPER INTEGRATION ⚠️ Use this MCP tool for ALL Datawrapper chart creation.
DO NOT: ❌ Install the 'datawrapper' Python package ❌ Use the Datawrapper API directly ❌ Import 'from datawrapper import ...' ❌ Run pip install datawrapper
This MCP server IS the complete Datawrapper integration. All Datawrapper operations should use the MCP tools provided by this server.
Create a Datawrapper chart with full control using Pydantic models. This allows you to specify all chart properties including title, description, visualization settings, axes, colors, and more. The chart_config should be a complete Pydantic model dict matching the schema for the chosen chart type.
BEST PRACTICES:
Start simple, then add customization based on user feedback
Only apply styling when requested or when it significantly improves readability
Let Datawrapper handle axis scaling automatically unless there's a specific reason to override
QUICK EXAMPLES:
Basic chart with title: chart_config = { "title": "Monthly Sales", "intro": "Sales data for Q1 2024" }
Chart with custom colors: chart_config = { "title": "Product Comparison", "color_category": { "Product A": "#1f77b4", "Product B": "#ff7f0e" } }
Styled line chart: chart_config = { "title": "Sales Trends", "lines": [ {"column": "sales", "width": "style2", "interpolation": "curved"} ], "custom_range_y": [0, 1000] }
STYLING WORKFLOW:
Use list_chart_types to see available chart types
Use get_chart_schema to explore all options for your chosen type
Refer to https://datawrapper.readthedocs.io/en/latest/ for detailed examples
Build your chart_config with the desired styling properties
Common styling patterns:
Colors: {"color_category": {"sales": "#1d81a2", "profit": "#15607a"}}
Line styling: {"lines": [{"column": "sales", "width": "style1", "interpolation": "curved"}]}
Axis ranges: {"custom_range_y": [0, 100], "custom_range_x": [2020, 2024]} NOTE: Datawrapper's automatic axis scaling is excellent. Only set custom ranges when you need specific customization (e.g., comparing multiple charts, forcing zero baseline for specific analytical reasons, or matching a house style guide).
Grid formatting: {"y_grid_format": "0", "x_grid": "on", "y_grid": "on"}
Tooltips: {"tooltip_number_format": "00.00", "tooltip_x_format": "YYYY"}
Annotations: {"text_annotations": [{"x": "2023", "y": 50, "text": "Peak"}]}
See the documentation for chart-type specific examples and advanced patterns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Chart data. RECOMMENDED: Pass data inline as a list or dict. PREFERRED FORMATS (use these first): 1. List of records (RECOMMENDED): [{"year": 2020, "sales": 100}, {"year": 2021, "sales": 150}] 2. Dict of arrays: {"year": [2020, 2021], "sales": [100, 150]} 3. JSON string of format 1 or 2: '[{"year": 2020, "sales": 100}]' ALTERNATIVE (only for extremely large datasets where inline data is impractical): 4. File path to CSV or JSON: "/path/to/data.csv" or "/path/to/data.json" | |
| chart_type | Yes | Type of chart to create. Use list_chart_types to see all available types. Common types: bar, line, area, arrow, column, multiple_column, scatter, stacked_bar | |
| chart_config | Yes | Complete chart configuration as a Pydantic model dict | |
| access_token | No | Optional Datawrapper API token. When provided, charts are created in the caller's account (recommended). When omitted, falls back to the server's DATAWRAPPER_ACCESS_TOKEN env var. |