Design
Charts
Build charts in Word, PowerPoint or LibreOffice and fill them with JSON data, or generate them as SVG images with Apache ECharts.
ENTERPRISE FEATURE
Available for:
Carbone Cloud
Carbone On-premise
Embedded Carbone JS
v4.0+
Overview
Generate dynamic charts in documents using two solutions:
- Native charts in LibreOffice or MS Office: design and configure visualizations directly within your text editor.
- ECharts 5 charts as images: design and configure visualizations from your JSON dataset.
The second solution is more powerful but requires a specific JSON structure.
Native Charts
This method is straightforward, like most other features:
- Create charts directly within your text editor: MS Office or LibreOffice.
- Insert Carbone tags into the data series within the XLSX/ODS sheet provided by your text editor.
Important Notes:
Compatible with ODT, DOCX, ODP, PPTX, and PDF files. Limited compatibility with XLSX and ODS files.
- In LibreOffice, the
{bindChart()}tag is required (details and examples in the LibreOffice example). - In XLSX templates, use the
:formatNformatter to display values, as in the XLSX example. - It is not possible to copy and paste charts created from an external XLSX/ODS file.
- It is not possible to link external spreadsheets as dynamic data series.
- Chart styling (titles, colors, captions, etc.) must be defined within the text editor. It is not possible to edit the styling from a JSON dataset, unlike with ECharts 5 charts.
List of supported charts
In Microsoft Office:
| Format | Types | Supported |
|---|---|---|
| 2D/3D Column | clustered, stacked, percent stacked |
|
| 2D/3D Bar | clustered, stacked, percent stacked |
|
| 2D/3D Line | line, stacked, percent stacked, line with markers, stacked line with markers, percent stacked line with markers |
|
| 2D/3D Area | area, stacked, percent stacked |
|
| 2D/3D Pie | pie |
|
| 2D/3D Pie | pie of pie, bar of pie |
|
| Doughnut | doughnut |
|
| Combo | clustered column/line, stacked area |
|
| Hierarchy | sunburst chart, treemap chart |
|
| Statistical | histogram, box and whisker |
|
| Waterfall | waterfall, funnel, stock, surface, radar |
|
| Scatter | scatter, bubbles |
|
| Map | map |
In LibreOffice:
| Format | Types | Supported |
|---|---|---|
| Column | normal, stacked, percent stacked |
|
| Bar | normal, stacked, percent stacked |
|
| Pie | normal, exploded, donut, exploded donut |
|
| Area | normal, stacked, percent stacked |
|
| Line | point only, points and lines, lines only, 3D lines |
|
| Scatter | point only, points and lines, lines only, 3D lines |
|
| Net | point only, points and lines, lines only, filled |
|
| Column and Line | normal, stacked |
|
| Stock | 1, 2, 3, 4 |
|
| Bubble | normal |
DOCX Example
In Word, insert a chart (Insert > Chart), right-click it and choose Edit Data. Delete the default values and write the tags in the data sheet: {d.months[i].name} and {d.months[i].revenue} on row 2, {d.months[i+1].name} and {d.months[i+1].revenue} on row 3.
Every column with an [i] cell needs its own [i+1] cell on the next row: one [i+1] cannot serve several [i] columns. Carbone keeps the chart type, colors and labels, and draws all the items. Generate a DOCX or a PDF.
{
"period": "July to December 2026",
"total": 1298050,
"months": [
{ "name": "Jul", "revenue": 182400 },
{ "name": "Aug", "revenue": 196750 },
{ "name": "Sep", "revenue": 204300 },
{ "name": "Oct", "revenue": 221900 },
{ "name": "Nov", "revenue": 238600 },
{ "name": "Dec", "revenue": 254100 }
]
}
Text of template.docx
Revenue report
{d.period}
Total revenue
{d.total:formatC(0)}
Revenue by month

Text of report.docx
Revenue report
July to December 2026
Total revenue
$1,298,050
Revenue by month
The monthly treasury FX report draws a line chart on a date axis and a column chart of the monthly averages.
ODT Example
In LibreOffice, insert a chart (Insert > Chart) and pick its type with the Chart Type button. Double-click the chart and open View > Data Table.
A numeric cell cannot hold a tag, but a category cell can. Write the category tag in the first column, followed by one {bindChart(700)=d.regions[i].sales} per series: it replaces the cell that holds the number 700 with the tag. Use a different number for every bound cell, and repeat the row with [i+1].
{
"period": "Q3 2026",
"regions": [
{ "name": "North America", "sales": 842, "target": 800 },
{ "name": "Europe", "sales": 615, "target": 640 },
{ "name": "Asia Pacific", "sales": 478, "target": 450 },
{ "name": "Latin America", "sales": 236, "target": 260 },
{ "name": "Africa", "sales": 164, "target": 150 }
]
}
Text of template.odt
SALES REVIEW
Regional sales
{d.period}
SALES VS TARGET BY REGION, IN $ THOUSANDS

Text of report.odt
SALES REVIEW
Regional sales
Q3 2026
SALES VS TARGET BY REGION, IN $ THOUSANDS
XLSX Example
In an XLSX template, a native chart draws the cells that a loop fills.
- Write the loop in the cells, with
:formatNon the values so that Carbone writes real numbers that the chart can draw. - Point the series of the chart to the cells of the loop (
B4:B5here). The chart covers every generated row. - PRE-RELEASE v5.18.0+ Add
{o.preReleaseFeatureIn=5018000}to the template: without it, the chart does not follow the rows added by the loop.
{
"title": "Website visitors, 2025",
"subtitle": "Unique visitors per month",
"months": [
{"name": "Jan", "visitors": 25390},
{"name": "Feb", "visitors": 24470},
{"name": "Mar", "visitors": 27180},
{"name": "Apr", "visitors": 28650},
{"name": "May", "visitors": 30240},
{"name": "Jun", "visitors": 31560},
{"name": "Jul", "visitors": 29820},
{"name": "Aug", "visitors": 30970},
{"name": "Sep", "visitors": 33410},
{"name": "Oct", "visitors": 35280},
{"name": "Nov", "visitors": 36540},
{"name": "Dec", "visitors": 34890}
]
}
| Row | A | B |
|---|---|---|
| 1 | {d.title} | |
| 2 | {d.subtitle}{o.preReleaseFeatureIn=5018000} | |
| 3 | MONTH | VISITORS |
| 4 | {d.months[i].name} | {d.months[i].visitors:formatN} |
| 5 | {d.months[i+1].name} |

| Row | A | B |
|---|---|---|
| 1 | Website visitors, 2025 | |
| 2 | Unique visitors per month | |
| 3 | MONTH | VISITORS |
| 4 | Jan | 25390 |
| 5 | Feb | 24470 |
| 6 | Mar | 27180 |
| 7 | Apr | 28650 |
| 8 | May | 30240 |
| 9 | Jun | 31560 |
| 10 | Jul | 29820 |
| 11 | Aug | 30970 |
| 12 | Sep | 33410 |
| 13 | Oct | 35280 |
| 14 | Nov | 36540 |
| 15 | Dec | 34890 |
Place the chart above or beside the loop: it stays in place. Learn more about charts in XLSX templates.
Advanced Echarts
Carbone embeds Apache Echarts: a rich, elegant, and powerful visualization library.
A chart configuration must be provided within your JSON dataset. This configuration should include the chart format, numerical values, and additional options. Carbone will inject the chart as an SVG image into the document.
Important Notes:
Compatible with all documents that support SVG images: ODT, ODS, ODP, ODG, DOCX, PPTX, XLSX, HTML, and PDF files.
ECharts offers a wide range of options, so we may not be able to answer all questions about your chart configuration through our chat support.
- Chart configuration does not currently support external dependencies (e.g., maps, JS scripts).
- Supported ECharts translations:
cs,de,en,es,fi,fr,it,ja,ko,pl,pt-br,ro,ru,si,th,zh. - Chart styling must be defined within the JSON dataset. Since the generated chart is an image, it cannot be edited within the template, unlike native charts.
- The generated SVG image may not be fully compatible with LibreOffice documents (or during PDF conversion). LibreOffice has many known issues. Microsoft documents have supported SVG since 2019. Here is a comparison of supported SVG features per tool. We may use a different solution to convert SVGs to images in a future version of Carbone.
Supported Echarts version :
- v5 : default version of Echarts
- v5a : modified version of ECharts, optimized for SVG compatibility with our main document converter, LibreOffice.
DOCX Echart Example
Insert a picture in the template as a placeholder, and write {d.chartOptions:chart} in its alternative text. Without the :chart formatter, Carbone reads the attribute as an image.
{
"period": "First half 2026",
"chartOptions": {
"type": "echarts@v5a",
"width": 700,
"height": 300,
"option": {
"color": ["#635bff", "#0a2540"],
"textStyle": { "fontFamily": "Helvetica Neue, Arial, sans-serif", "color": "#697386" },
"legend": { "top": 0, "right": 0, "icon": "roundRect", "itemWidth": 10, "itemHeight": 10 },
"grid": { "top": 40, "left": 8, "right": 8, "bottom": 8, "containLabel": true },
"xAxis": {
"type": "category",
"data": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"axisTick": { "show": false },
"axisLine": { "lineStyle": { "color": "#e3e8ee" } }
},
"yAxis": {
"type": "value",
"min": 0,
"max": 300,
"interval": 100,
"axisLabel": { "formatter": "${value}k" },
"splitLine": { "lineStyle": { "color": "#e3e8ee" } }
},
"series": [
{ "name": "Sales", "type": "bar", "barWidth": 36, "data": [182, 196, 214, 208, 231, 247] },
{ "name": "Target", "type": "line", "symbolSize": 7, "lineStyle": { "width": 2 }, "data": [190, 195, 205, 215, 225, 240] }
]
}
}
}
Text of template.docx
Sales review
{d.period}
Sales vs target by month
[Picture: {d.chartOptions:chart}]

Text of report.docx
Sales review
First half 2026
Sales vs target by month
[Picture]
The JSON holds the chart configuration, here under chartOptions:
{
"chartOptions": {
"type": "echarts@v5a",
"width": 700,
"height": 300,
"theme": null,
"option": { }
}
}
typeis the ECharts version.widthandheightset the size of the image, andthemetakes a theme object from the theme builder. All three are optional.optionis required: your ECharts options and data. Start from the ECharts examples, such as the line chart.
If you hit a limit, contact us on the chat.
HTML Echart Example
In an HTML template, write the :chart formatter in the src of an image: <img src="{d.chartOptions:chart}">. Carbone replaces it with the chart as an SVG image. The JSON configuration is the one described in the DOCX example.
To get a PDF, add {o.converter=C} in the <body>: Chromium draws the SVG like a browser. The width and height of the configuration set the size of the image. Use the width and height attributes or the CSS of the <img> to scale it in the page: width: 100%; height: auto keeps its proportions.
{
"period": "First half 2026",
"total": 1278000,
"chartOptions": {
"type": "echarts@v5a",
"width": 700,
"height": 300,
"option": {
"color": ["#635bff"],
"textStyle": { "fontFamily": "Helvetica Neue, Arial, sans-serif", "color": "#697386" },
"grid": { "top": 24, "left": 8, "right": 8, "bottom": 8, "containLabel": true },
"xAxis": {
"type": "category",
"data": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"axisTick": { "show": false },
"axisLine": { "lineStyle": { "color": "#e3e8ee" } }
},
"yAxis": {
"type": "value",
"min": 0,
"max": 300,
"interval": 100,
"axisLabel": { "formatter": "${value}k" },
"splitLine": { "lineStyle": { "color": "#e3e8ee" } }
},
"series": [
{ "type": "bar", "barWidth": 40, "data": [182, 196, 214, 208, 231, 247],
"label": { "show": true, "position": "top", "color": "#0a2540" } }
]
}
}
}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sales report</title>
<style>
@page { size: A4; margin: 0; }
body { margin: 0; padding: 48px; font-family: "Helvetica Neue", Arial, sans-serif; color: #0a2540; }
h1 { margin: 0 0 4px; font-size: 26px; }
.period { margin: 0 0 32px; color: #697386; }
.label { margin: 0 0 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #697386; }
.total { margin: 0 0 32px; font-size: 22px; font-weight: 700; }
img { display: block; width: 100%; height: auto; }
</style>
</head>
<body>
<h1>Sales report</h1>
<p class="period">{d.period}</p>
<p class="label">Total sales</p>
<p class="total">${d.total:formatN(0)}</p>
<p class="label">Sales by month</p>
<img src="{d.chartOptions:chart}" alt="Sales by month">
{o.converter=C}
</body>
</html>
See the multi-page annual report with ECharts charts example.