Configuration
Complete options reference
Zero Config Defaults
Uncharted works out of the box with minimal configuration. For most chart types, you only need type and file:
charts:
sales:
type: stacked-column
file: charts/sales.csv
With a CSV like:
quarter,revenue,costs,profit
Q1,100,80,20
Q2,120,90,30
Q3,140,85,55
Q4,160,95,65
Uncharted automatically:
- Uses the first column (
quarter) as category labels - Uses remaining columns (
revenue,costs,profit) as data series - Uses column header names as legend labels
- Calculates appropriate axis scaling from the data
This convention applies to most chart types:
| Chart Type | First Column | Remaining Columns |
|---|---|---|
| line, stacked-column | X-axis categories | Y-axis series |
| timeseries | X-axis values (years or dates) | Y-axis series |
| stacked-bar | Y-axis categories | X-axis series |
| bubble | X-axis categories | Detected by name (y, size, series) |
| donut | Segment labels | Segment values |
| scatter | Point labels | Detected by name (x, y, series, size) |
| sankey | Source nodes | Target, then value |
When you need more control—custom labels, axis limits, number formatting—use the axis configuration options described below.
Chart Options
All options available when defining a chart:
| Option | Type | Description |
|---|---|---|
type |
string | Chart type (required): donut, stacked-bar, stacked-column, line, timeseries, bubble, scatter, sankey |
title |
string | Chart title |
subtitle |
string | Subtitle below title |
file |
string | Path to CSV file (relative to dataDir) |
data |
array | Inline data array (alternative to file) |
x |
object | X-axis configuration (see below) |
y |
object | Y-axis configuration (see below) |
proportional |
boolean | Maintain data aspect ratio (scatter, sankey) |
center |
object | Donut center content |
showPercentages |
boolean | Show percentages in donut legend |
legend |
boolean | Show/hide legend (default: true) |
animate |
boolean | Override global animation setting |
lines |
boolean | Show connecting lines (line charts, default: true) |
dots |
boolean | Show dots at data points (line/timeseries, default: true for line, false for timeseries) |
downloadData |
boolean/string | Enable download link |
downloadImage |
boolean/string | Enable image download link (requires image generation) |
icons |
string/object | Font Awesome icon(s) for dot/line/scatter charts |
alt |
string | Accessible description (used for aria-label and image alt text) |
image |
object | Per-chart image generation overrides (see Features) |
Column Definition Formats
Columns can be specified in three ways:
Single column (string):
x:
column: month
Multiple columns (array - uses column names as labels):
y:
columns: [prs, commits]
Multiple columns with labels (object):
y:
columns:
prs: Pull Requests
commits: Commits
Axis Properties
Each axis can have these properties:
| Property | Type | Description |
|---|---|---|
column |
string | Single column name |
columns |
array/object | Multiple columns, optionally with display labels |
min |
number | Minimum axis value |
max |
number | Maximum axis value |
title |
string | Axis title (dot, line, timeseries, scatter) |
format |
object | Number formatting options |
rotateLabels |
boolean | Rotate labels vertically (x-axis only) |
Axis Keys by Chart Type
| Chart Type | Axis Keys |
|---|---|
| line, stacked-column | x (categories), y (values) |
| timeseries | x (time values), y (values) |
| stacked-bar | y (categories), x (values) |
| bubble | x (categories), y (values), series, size |
| scatter | x, y (coordinates), label, series, size |
| donut | label, value |
| sankey | source, target, value |
Chart Type Examples
Line Chart
charts:
example:
type: line
title: "Trend Over Time"
file: data.csv
x:
column: date
title: Date
rotateLabels: true
y:
columns:
visitors: Unique Visitors
pageviews: Page Views
max: 100
title: "Visits"
format: { compact: true }
lines: true # Show connecting lines (default: true)
dots: true # Show dots at data points (default: true)
# icons: "fa-solid fa-star" # Optional: use icons instead of dots
legend: true
animate: true
Use lines: false to display dots without connecting lines.
Time-Series Chart
charts:
example:
type: timeseries
title: "Population Over Time"
file: data.csv
x:
column: year # Supports years (1994) or ISO dates (2024-02-17)
title: Year
y:
columns:
cattle: Cattle
sheep: Sheep
title: "Population"
format: { compact: true }
dots: false # Hide dots (default: false for timeseries)
# icons: "fa-solid fa-star" # Optional: icons appear in legend only
legend: true
animate: true
Stacked Column Chart
charts:
example:
type: stacked-column
title: "Quarterly Results"
file: data.csv
x:
column: quarter
rotateLabels: true
y:
columns:
revenue: Revenue
costs: Costs
profit: Profit/Loss
min: -50
max: 100
format: { thousands: true }
legend: true
animate: true
downloadData: "Download quarterly data"
Stacked Bar Chart (Horizontal)
charts:
example:
type: stacked-bar
title: "Category Breakdown"
file: data.csv
y:
column: category # Categories on left side
x:
columns: # Value series (bars extend right)
completed: Completed
pending: Pending
blocked: Blocked
max: 100
format: { compact: true }
legend: true
animate: true
downloadData: true
Bubble Chart
charts:
example:
type: bubble
title: "Quarterly Performance"
file: data.csv
x:
column: quarter # Categorical X-axis
title: Quarter
y:
column: value
min: 0
max: 100
title: "Performance"
format: { compact: true }
series:
column: metric
title: Metric # Legend title
size:
column: magnitude
title: Market Size # Size legend title
legend: true
animate: true
Bubble charts use categorical X-axis (like dot/line) with variable dot sizes (like scatter).
Scatter Chart
charts:
example:
type: scatter
title: "Correlation Analysis"
file: data.csv
x:
column: population
min: 0
max: 1000
title: "Population (millions)"
format: { compact: true }
y:
column: gdp
min: 0
max: 50000
title: "GDP per Capita"
format:
thousands: true
currency: { symbol: "$" }
label:
column: country # Point identifier for tooltips
series:
column: region
title: Region # Legend title
size:
column: area
title: Land Area # Size legend title
# Optional: icons keyed by series value
icons:
asia: "fa-solid fa-earth-asia"
europe: "fa-solid fa-earth-europe"
proportional: true
legend: true
animate: true
Donut/Pie Chart
charts:
example:
type: donut
title: "Market Share"
file: data.csv
label:
column: category # Segment names (default: first column)
value:
column: share # Segment values (default: second column)
format:
compact: true
currency: { symbol: "$" }
center:
value: total
label: "Total Sales"
showPercentages: true
legend: true
animate: true
Sankey Chart
charts:
example:
type: sankey
title: "Budget Flow"
file: data.csv
source:
column: from
target:
column: to
value:
column: amount
format:
compact: true
currency: { symbol: "$" }
nodeWidth: 20
nodePadding: 10
endLabelsOutside: true
proportional: true
legend: true
animate: true
Number Formatting
Format options can be specified at the axis level:
| Option | Type | Description |
|---|---|---|
thousands |
boolean | Add thousand separators (1,000) |
compact |
boolean | Compact notation (1K, 1M) |
decimals |
number | Fixed decimal places |
currency |
object | Currency formatting |
currency.symbol |
string | Currency symbol ("$", "€") |
currency.position |
string | "before" or "after" |
Example:
y:
columns: [revenue, profit]
format:
thousands: true
currency:
symbol: "$"
position: before
Plugin Options
Global options passed when registering the plugin:
eleventyConfig.addPlugin(uncharted, {
dataDir: '_data/charts', // CSV directory relative to root
animate: true, // enable animations
cssPath: '/css/uncharted.css', // stylesheet output path
injectCss: true, // auto-inject CSS link
downloadData: true, // show download links
downloadImage: true, // show image download links
dataPassthrough: true, // copy CSVs to output
dataPath: '/data/' // public path for CSVs
});
| Option | Type | Default | Description |
|---|---|---|---|
dataDir |
string | Eleventy's dir.data |
Directory for CSV files, relative to root (e.g., _data/charts) |
animate |
boolean | false |
Enable animations globally |
cssPath |
string | '/css/uncharted.css' |
Output path for stylesheet |
injectCss |
boolean | true |
Automatically inject CSS link |
downloadData |
boolean | false |
Show download links on charts |
downloadImage |
boolean | false |
Show image download links (requires image.enabled) |
dataPassthrough |
boolean | false |
Copy CSV files to output |
dataPath |
string | '/data/' |
Public URL path for data files |
image |
object | — | Image generation options (see below) |
Image Generation Options
The image object accepts these properties:
| Property | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Enable PNG image generation |
outputDir |
string | '/images/charts/' |
Output directory for images |
width |
number | 800 |
Default image width in pixels |
height |
number | 400 |
Default image height in pixels |
scale |
number | 2 |
Device scale factor (2 for retina) |
background |
string | '#ffffff' |
Default background color |
skipDev |
boolean | true |
Skip image generation during --serve/--watch |
Per-chart image objects can override enabled, width, and height:
| Property | Type | Description |
|---|---|---|
enabled |
boolean | Override global enable/disable |
width |
number | Image width for this chart |
height |
number | Image height for this chart |