/betterstack:chart-generationfrom Better Stack
Reference for Better Stack dashboard chart types, units, and settings. Load after building queries to configure charts with create_dashboard_chart and update_dashboard_chart tools.
Ships in Better Stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This guide covers everything needed to create properly configured charts using the create_dashboard_chart and update_dashboard_chart tools.
chart_building_help has the server's current reference.
To make a chart filterable, define a template variable with update_dashboard (send the dashboard's whole variables list with the new one), then reference it in the query as {{var}} (required) or [[ ... {{var}} ... ]] (optional). See the dashboard-builder skill's "Dashboard template variables" section.
| Type | Use Case | Key Requirement |
|---|---|---|
line_chart | Time-series trends, metrics over time | Query must have time column |
bar_chart | Comparisons, distributions | Works with time or categories |
number_chart | Single KPI, current value | Shows latest/aggregated value |
table_chart | Detailed data, logs, breakdowns | Any columnar data |
pie_chart | Distribution, proportions | Needs series + value columns |
heatmap_chart | Correlation, density over time | Needs time, series, value |
scatter_chart | Correlation between variables | X/Y numeric columns |
gauge_chart | Percentage metrics (0-1 range) | Single value, use unit: "percent" |
map_chart | Geographic distribution (by IP, airport, city, or country) | Value column + a location() column, grouped by location. Load map-hierarchy-charts skill |
hierarchy_chart | Fleet overview — one colored hexagon per entity (host map) | One row per entity: value column + label column. Load map-hierarchy-charts skill |
static_text_chart | Markdown text, notes, documentation | Pass Markdown in query param |
See metrics-query skill for query syntax.
Funnels (funnel_chart, funnel_trend_chart) are not dashboard charts: they live in Explore, built from steps in the Better Stack UI.
| Unit | Description |
|---|---|
B_si | Bytes (SI: KB, MB, GB) |
B_iec | Bytes (IEC: KiB, MiB, GiB) |
kB, MB, GB, TB, PB | Fixed unit |
| Unit | Description |
|---|---|
B_si/s | Bytes per second (auto-scale) |
kB/s, MB/s, GB/s | Fixed rate unit |
bit_si/s | Bits per second (auto-scale: bps, kbps, Mbps) |
kbit/s, Mbit/s, Gbit/s | Fixed rate unit (renders as kbps, Mbps, Gbps) |
| Unit | Description |
|---|---|
ns | Nanoseconds |
μs | Microseconds |
ms | Milliseconds |
s | Seconds |
m | Minutes |
h | Hours |
d | Days |
| Unit | Description | Example Output |
|---|---|---|
shortened | Auto-scale (K, M, B) | 1.5K, 2.3M |
e/s | Events per second | 150 e/s |
rps | Requests per second | 1.2K rps |
rpm | Requests per minute | 72K rpm |
| Unit | Description | Example Output |
|---|---|---|
percent | A 0-1 ratio, multiplied by 100 for display | 0.75 renders as 75% |
auto | Auto-detect | varies |
none | Raw number | 1234.56 |
unit: "percent" multiplies the query's value by 100, so the query must return a 0-1 ratio. Never multiply by 100 in the query: * 100 with percent renders 75% as 7500%. When a metric is already reported 0-100 (e.g. cpu_percent), divide it by 100.
-- GOOD: system_cpu_utilization_ratio is 0-1, so 0.75 renders as 75%
avgMerge(value_avg) AS "CPU usage"
-- BAD with unit: "percent": renders 75% as 7500%
avgMerge(value_avg) * 100 AS "CPU usage"
-- GOOD: a metric that is already 0-100, divided back to 0-1
avgMerge(value_avg) / 100 AS "CPU usage"
Every number you set on a percent chart is a 0-1 ratio too: y_axis_max: 1, gauge max: 1, color_upper_threshold: 0.9, and a chart alert's threshold value: 0.9 for 90%.
The exception is stacking: "stack_to_100" on a bar chart: it sets percent itself and scales each bar to 100% when drawing, so its query returns raw values (counts, not shares).
| Setting | Purpose | Default |
|---|---|---|
time_column | Column for X-axis time | "time" |
series_column | Column that groups data into series | "series" |
value_columns | Columns with numeric values to plot | ["value"] |
These settings are optional — inferred from query results when not provided.
value_columnsvalue_columns MUST exactly match the SQL column alias. If the query says AS "Operations", then value_columns: ["Operations"]. A mismatch makes the chart appear empty because it can't find the data column — this is the #1 cause of empty charts. Never leave value_columns as the default ["value"] when the SQL uses a descriptive alias.
For single-series charts, use a descriptive alias (not AS value):
SELECT {{time}} AS time, avgMerge(value_avg) AS "Memory usage" FROM ...
-- value_columns: ["Memory usage"]
AS value is FORBIDDEN as the metric alias for ANY chart that renders a legend. The chart engine displays the column alias in the legend when there's no series_column, or as the y-axis label / hover tooltip alongside series names when there IS one. A legend or hover that reads "value" is a visible bug. Always alias as the chart title (or a tighter version of it):
AS "Request rate", value_columns: ["Request rate"]AS "Memory available", value_columns: ["Memory available"]AS "Response time", value_columns: ["Response time"]This applies to single-series AND multi-series charts.
series_column — auto-inferred, set explicitly to controlThe backend auto-infers series_column from query result columns when you omit it. Omitting it does NOT prevent it from being set — to disable it you must explicitly pass series_column: "".
"series" when the query has a GROUP BY on a label/tag aliased as series (e.g., label('instance_name') AS series ... GROUP BY time, series)."" (empty string) for charts that should have NO series grouping:
number_chart with a single aggregate valueerrors / total)If series_column is set incorrectly, the chart engine interprets data values as series names, producing broken visuals with garbage labels.
x_axis_type)| Value | Use Case |
|---|---|
time | Time-series data (default) |
category | Discrete categories |
value | Continuous numeric axis |
Allowed per chart type: line_chart time/value; bar_chart and heatmap_chart time/category; scatter_chart all three. A line/bar chart with x_axis_type other than time can't have chart alerts.
y_axis_type) — scatter onlyscatter_chart also takes y_axis_type: value (numeric Y axis, default) or category (evenly spaced rows). Other chart types ignore it.
y_axis_scale)| Value | Use Case |
|---|---|
linear | Most data (default) |
log | Data spanning multiple orders of magnitude |
| Setting | Purpose | Example |
|---|---|---|
y_axis_min | Force minimum | 0 for percentages |
y_axis_max | Force maximum | 1 with unit: "percent" (0-1 data), 100 for 0-100 data without it |
Important: For percentage data calculated as ratio (0-1), set y_axis_max: 1, NOT 100.
treat_missing_values)Default: connected for non-stacked, previous for stacked. Only deviate when the metric's semantics genuinely require it.
| Value | When to use |
|---|---|
connected | Default for non-stacked. Bridges polling gaps — for rates, gauges, percentages, latencies. Missing poll ≠ zero. |
previous | Default for stacked. connected breaks stacking (sawtooth collapse). Step-shapes between samples. |
zero | Sparse-event charts where a missing bucket really means "zero events" (rare errors, throttle counts, deadlocks). Or .fill(0) source. |
disconnected | Detecting outages — when showing the gap itself is the signal. |
Critical for cloud-pulled metrics (Azure / GCP / AWS / CloudWatch / Prometheus-pull): missing data ≠ zero events. These APIs poll on a schedule and occasionally miss a bucket. Using zero creates spurious dips that look like outages. Default to connected and only switch to zero when the source truly fills zeros.
Stacking restriction: when stacking is "stack" or "stack_to_100", only "previous" and "zero" are available. "connected" and "disconnected" are not supported for stacked charts.
stacking) - Line/Bar Charts| Value | Behavior |
|---|---|
dont_stack | Overlapping series (line default) |
stack | Stacked series (bar default) |
stack_to_100 | Percentage stacking: sets percent itself and scales each bar to 100% when drawing, so its query returns raw values (counts, not shares) |
Rule: Stack only series that are non-overlapping parts of a whole (e.g. memory Used + Cache + Free — and exclude the Total series itself, it double-counts its parts). The full stack-vs-don't decision rules (including the default-to-stack style for line charts) live in the dashboard-builder skill's Stacking Rules — when both skills are loaded, follow those.
Prefer "shown_below" placement. Options: hidden, shown_below, shown_below_with_statistics (line/bar/scatter: renders min/mean/max next to each series name), shown_right.
| Chart Type | Key Settings |
|---|---|
line_chart | stacking per Stacking section (dashboard-builder defaults lines to stack); treat_missing_values: "connected" non-stacked / "previous" stacked; show_previous_period overlays the prior period for comparison |
bar_chart | stacking: "stack", orientation: "vertical" or "horizontal" |
number_chart | Coloring via color_mode (load chart-styling skill). Series labels are never displayed — the chart title is the only visible label - make title descriptive. Include {{time}} — number charts render a line-chart in background. |
table_chart | See Table Chart Settings below |
pie_chart | Requires series_column and value_columns |
gauge_chart | min (default 0) and max (the goal value, default 1) — set both explicitly. For 0-1 percentage values use unit: "percent" with max: 1 |
heatmap_chart | time_column (X) + x_axis_type, series_column (Y) + series_unit (Y-label unit), single value_columns entry (cell color), heatmap_color_mode (chart-styling skill) |
scatter_chart | time_column (X) + x_axis_type, value_columns (Y) + y_axis_type, series_column groups points, point_size_column sizes them (default "size") |
map_chart | Load map-hierarchy-charts skill |
hierarchy_chart | Load map-hierarchy-charts skill |
All charts support: unit (+ custom_unit: true for a literal suffix outside the supported list), decimal_places: 2, legend. Exception: table_chart ignores the chart-level unit — use column_units.
Series colors and order, number chart coloring thresholds, heatmap color categories (heatmap_color_mode + value_categories), gauge bounds, y-axis tuning (y_axis_auto_range, log scale), show_previous_period, and the full per-key settings reference with cross-setting gotchas: load the chart-styling skill.
Two types of bar charts — configure each differently:
Category bar charts (toplists, rankings) — NO time dimension:
x_axis_type: "category" (NOT "time" — there is no time column)time_column: "series" (point to the category/grouping column, NOT "time")orientation: "horizontal" (category labels are usually names){{time}}, groups by a tag onlyTime-series bar charts (values over time) — HAS time dimension:
x_axis_type: "time" (default)orientation: "vertical"{{time}} AS time and GROUP BY time, seriesCommon mistakes:
x_axis_type: "time" on a category bar chart — breaks rendering (no time column exists)time_column: "time" on a category bar chart — must be "series" (the grouping column){{time}}? No -> x_axis_type: "category" + time_column: "series"Table charts format each column independently — they ignore the chart-level unit setting. Configure per-column units and progress bar highlighting via the settings object.
column_unitsSet units for individual columns. Each key is the column alias from the query, value is an object with unit and custom_unit:
{
"column_units": {
"CPU usage": { "unit": "percent", "custom_unit": false },
"Memory usage": { "unit": "percent", "custom_unit": false },
"Uptime": { "unit": "s", "custom_unit": false },
"Disk used": { "unit": "B_si", "custom_unit": false }
}
}
Column names must exactly match the SQL alias. The unit values are the same as chart-level units (see Units Reference above).
percentage_highlight_columnsAdd colored progress bar backgrounds to percentage columns (0-1 range values). Pass an array of column names:
{
"percentage_highlight_columns": ["CPU usage", "Memory usage"]
}
This renders a colored horizontal bar behind each cell value, making it easy to spot high/low values at a glance. Only use for columns that contain 0-1 ratio values displayed as percentages.
map_chart and hierarchy_chart are not time-series and have their own query shapes and settings — load the map-hierarchy-charts skill before creating either.
unit setting renders the suffix; titles say what, not how much ("CPU utilization", not "CPU utilization (%)").dashboard-builder skill — follow them for every dashboard, section, and chart title.Shows as a tooltip next to the chart title. Use rarely — charts must be comprehensible without it. A tooltip earns its place only by teaching something the chart can't show on its own: a non-obvious threshold ("DiskPressure flips at 85% used — once tripped, kubelet evicts pods until usage drops"), an invariant ("Capture backlog > 0 means the pipeline is falling behind"), a debugging hint, or a one-clause definition of an unfamiliar term used in the title (PTU, DLQ, ...). If you can't meet that bar, leave the field empty — the chart is better without filler.
Forbidden content (these belong on the chart visually, not in prose):
unit setting handles that)Punctuation: single-sentence tooltip → no trailing full-stop; 2+ sentences → every sentence ends with one. No parentheses. No code-shaped symbols (=, →, &, ASCII art) — write words ("caps at 100", not "caps = 100"); real numbers ("above 85%") and conventional abbreviations (vs., e.g.) are fine. vs always with a period — in tooltips and titles.
Read references/common-mistakes.md (in this skill's directory) before you create or edit a chart: it lists the settings and query mistakes that break charts (units, percent ratios, legends, series names, axis bounds) and the correct approach for each.
See dashboard-layout skill for layout rules, row templates, coordinate math, and the mandatory planning process.
Before creating each chart:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub betterstackhq/claude-plugin --plugin betterstack17 skills in this plugin
/chart-alertsGuide for creating and managing Better Stack chart alerts. Load when asked to set up alerting, create alerts on charts, or configure monitoring thresholds./chart-stylingBetter Stack chart styling and advanced settings reference - series colors and order, number chart coloring thresholds, heatmap color categories, gauge bounds, y-axis tuning, custom units, and the per-key settings table with cross-setting gotchas. Load when configuring how a chart looks beyond defaults, or when unsure which settings key applies to a chart type./collector-queriesProven metrics queries for Better Stack Collector sources (the source tool's Platform "Collector") - per-host node_* metrics, per-container and per-service container_resources_*, requests and errors by destination, TCP health, and the container-level saturation checks that host averages hide. Load after metrics-query when the source platform is Collector, for health checks, resource questions and service dashboards.Other plugins' skills for the same job