Visuals reference
Every visual is a VisualSpec:
{
id?: string; // stable id (auto-generated otherwise)
type: 'clusteredColumn'; // see the table below
title?: string;
layout?: { x, y, w, h, z? }; // grid units (page default: 12 columns × 44px rows)
fields?: { [role]: FieldSpec | FieldSpec[] };
filters?: FilterSpec[]; // visual-level filters
format?: { ...format pane }; // see "Common format options" below
sort?: { field: 'Total Sales', direction: 'desc' };
top?: number; // keep first N groups after sorting
interaction?: 'filter' | 'highlight' | 'none'; // how it reacts to other visuals
interactionsFrom?: { [sourceVisualId]: 'filter' | 'highlight' | 'none' };
drill?: { level, path, skip? }; // persisted drill state
hidden?: boolean; className?: string; style?: string;
}A FieldSpec is one of:
-
a measure name, e.g.
'Total Sales' -
a column ref, e.g.
'Products[Category]'. In a measure role, this gets an implicit aggregation. -
{ field: 'Sales[Qty]', aggregation: 'avg', name: 'Avg qty', format: '#,0.0' } -
{ expression: 'SUM(Sales[Amount]) * 1.1', name: 'Forecast', format: '$#,0' }
Gallery #
Every built-in visual with the demo data (light theme). The same images back the visual regression tests.
area | boxPlot | bullet |
calendar | card | clusteredBar |
clusteredColumn | decompositionTree | donut |
funnel | gauge | heatmap |
histogram | kpi | line |
lineClusteredColumn | map | matrix |
multiRowCard | percentStackedBar | percentStackedColumn |
pie | radar | ribbon |
sankey | scatter | scatter-webgl |
slicer-list | slicer-range | slicer-tiles |
stackedArea | stackedBar | stackedColumn |
table | text | treemap |
waterfall | sunburst | scorecard |
filledMap | column-error-bars | line-forecast |
gantt | candlestick | chord |
network |
Catalogue #
| Type (aliases) | Roles | Notes |
|---|---|---|
clusteredColumn (column) | category* (drillable, multiple) · legend · values* (multiple) · smallMultiples | Sorted by first value, descending, unless the category is a number, a date or has sort-by |
stackedColumn, percentStackedColumn | same | 2 px gaps between segments. Categories sorted by total |
clusteredBar (bar), stackedBar, percentStackedBar | same | Horizontal versions |
line | category* (drillable) · legend · values* · smallMultiples | Crosshair tooltip, end labels (four or fewer series), markers (16 or fewer points), cross-highlight |
area, stackedArea | same | 10% area wash. Stacked area sums series |
lineClusteredColumn (combo) | category* · legend (columns) · values (columns) · lineValues | Dual-axis or shared value axis. Configurable secondary Y-axis (format.secondaryValueAxis), primary/secondary axis titles, and column data labels |
waterfall | category* (drillable) · values* | Running total with connectors, increase / decrease / total colours, optional total bar |
pie, donut | legend* (drillable) · values* | Folds slices past the palette into "Other". Donut shows a centre total |
treemap | category* (drillable) · values* | Squarified layout |
scorecard (goals) | values* (goals, multiple) · targets (paired with values in order) · trend | Current value (the latest trend point, else the total), target, progress, status and sparkline per goal; settings in format.scorecard.goals |
sunburst | category* (multiple: one ring per level, first innermost) · values* | Each level is a real measure evaluation (ratios stay right); children split their parent's angle by value; centre total; click any ring to select that level |
funnel | category* · values* | Shows % of first stage |
scatter (bubble) | details* · legend · x* · y* · size | Bubble area ∝ size. Cross-highlight, trend line |
heatmap | rows* · columns* · values* | Sequential single-hue ramp, gradient legend, cell labels when they fit |
decompositionTree (decomp) | values* · explainBy* (multiple) | Split a total level by level, click nodes to narrow down, automatic "High value / Low value" splits. Cross-filters the page |
histogram | values* (numeric column) · weight (optional measure) | Bins by Sturges' rule or format.histogram.bins / binWidth |
boxPlot | category · values* (numeric column) | Quartiles, 1.5 × IQR whiskers, outliers, mean marker |
bullet | category · value* · target · maximum | Value bar over qualitative bands with a target tick |
radar | category* (spokes, 3 or more) · legend · values* | One polygon per series on a shared radial scale |
sankey | source* · target* · values* | Multi-stage flows (a target that is also a source becomes a middle column) |
ribbon | category* · legend* · values* | Stacked by rank in each column, with ribbons showing rank changes |
map (bubbleMap) | location* · legend · latitude · longitude · size | Columns are averaged per location. Without latitude and longitude, bubbles sit at the centre of their region (format.map.boundaries or geojson). Optional clustering |
filledMap (choropleth) | location* · values* | Built-in boundaries (@prismbi/prismbi/geo) or your geojson. Gradient or classed legend |
card | value* · delta | Auto-sized callout value, signed delta with good/bad colour |
multiRowCard | category · values* | One card per group |
kpi | trend · value* · target | Headline is the last trend point. Shows % vs goal and a sparkline |
gauge | value* · min · max · target | 180° radial gauge with multi-tier threshold zones (format.gauge.thresholds) and optional tapered needle (format.gauge.needle) |
table | columns* (columns and measures mixed) | Click a header to sort. Interactive drag column resizing (.pbi-col-resizer), totals, conditional formatting, in-header quick search (format.table.search), pinning, incremental rendering |
matrix | rows (hierarchy) · columns · values* | Interactive drag column resizing (.pbi-col-resizer), expand/collapse, column pivot, real subtotals and totals, in-header quick search (format.matrix.search) |
slicer | field* (several fields give a hierarchy tree) | list · dropdown · tiles · between · relative date · tree. Sync groups across pages |
gantt | task* · start* · end · progress · resource | Project schedule timeline with progress fills and milestone diamonds |
candlestick | category* · open* · high* · low* · close* · volume | Financial OHLC stock chart with wicks, bodies and bottom volume bars |
chord | source* · target* · values* | Circular relationship flows and inter-entity transfers with quadratic ribbons |
network | source* · target* · values · group · size | Force-directed entity network graph with Coulomb repulsion, Hooke springs, node dragging, cluster coloring and cross-filtering |
text (textbox) | values (optional) | Mini-markdown with {{Measure name}} placeholders |
actionButton (button) | _(none)_ | Interactive canvas button: back, page navigation, bookmark restore, clear all filters, dynamic drill-through, export (PDF/XLSX/PPTX/image), or external URL |
* marks a required role.
Small multiples (Trellis / Grid Layouts): put one or more fields in smallMultiples (column, bar, line, area, combo, waterfall, scatter and bullet charts) to facet the visual into a responsive multi-panel grid with unified scales and a single shared legend:
-
Unified Axis Domains:
sharedAxis: true(default) harmonizes primary and secondary Y-scales across panels.sharedCategoryAxis: true(default) guarantees that all panels share the identical X-axis categories and scale positions, inserting blank slots where a panel lacks data for side-by-side comparability. -
2D Trellis Matrix: provide two fields in
smallMultiples: ['Region[Country]', 'Product[Category]']and setlayout: 'matrix'to render a true 2D matrix facet with column headers on top and row headers on the left. -
Grid Density & Sizing: customize
columns,rows, andgap(px). -
Axis Deduplication:
outerAxesOnly: truehides repetitive Y-axis labels on inner columns and X-axis labels on inner rows, maximizing data ink while preserving grid alignment. -
Card & Header Polish: style panels with
border: true,borderColor,panelBackground,padding,headerAlignment: 'left' | 'center' | 'right',headerPosition: 'top' | 'bottom',headerFontSize, andheaderColor.
Common format options #
All of these are optional. Values merge as: base defaults ← visual defaults ← theme.visualStyles['*'] ← theme.visualStyles[type] ← spec.format.
format: {
title: { show: true, text, subtitle, fontSize, color, align: 'left'|'center'|'right', bold: true, divider?: { color: '#e2e8f0', width: 1, margin: 6 }, tooltip?: 'Methodology info' },
background: { show: true, color, transparency: 0 }, // 0–100
border: { show: true, color, width: 1, radius },
shadow: { show: false, color: 'rgba(0,0,0,0.06)', blur: 14, y: 4 },
padding: 12,
header: { show: true, focusMode: true, exportData: true, showAsTable: true, drill: true, tooltip?: 'Visual description' },
tooltip: { show: true, page: 'tooltip-page-id' }, // report tooltip page
legend: { show: 'auto' | true | false, position: 'top'|'bottom'|'left'|'right', fontSize },
dataLabels: {
show: false, format, displayUnits: 'auto', decimals, fontSize, color, position: 'auto',
contrastColor: true, // auto-adjust font color for WCAG contrast on marks
rules: [{ min: 0, color: '#27ae60' }, { max: -1, color: '#e74c3c' }], // conditional font colors
},
categoryAxis: { show: true, maxLabelWidth: 120, labelAngle: 'auto'|0|45|90,
type: 'auto'|'categorical'|'continuous', // auto = continuous for date/number fields on line & area
scale: 'linear'|'log' }, // scatter x-axis
valueAxis: { show: true, displayUnits: 'auto', decimals, min, max, gridlines: true, tickCount: 5, scale: 'linear'|'log', title?: string },
secondaryValueAxis: { show: true, displayUnits: 'auto', decimals, min, max, tickCount: 5, mode: 'auto'|'on'|'off', title?: string, format?: string },
colors: { default, palette: [...], series: { 'Total Sales': '#...' }, categories: { 'Bikes': '#...' },
rules: [{ op: '<', value: 0, color: '#d03b3b' }], // single-series charts, first match wins
gradient: { min: '#cde2fb', max: '#0d366b' } }, // single-series charts, by value
analytics: {
referenceLines: [{ type: 'average' | 'median' | 'min' | 'max' | 'percentile' | 'constant', value?, percentile?, label?: 'Goal {value}' | false, color?, dash? }],
referenceBands: [{ from: 100, to: 200, label: 'Target Zone', color: '#27ae60', opacity: 0.15, axis: 'y' }],
trendLine: false | true | { color },
},
bars: { maxThickness: 24, radius: 4, gap: 2, categoryGap: 0.35 },
lines: { width: 2, markers: 'auto', smooth: false, area: false, areaOpacity: 0.1, endLabels: true, collisionAvoidance: true },
animation: { enabled: true, duration: 280 },
smallMultiples: {
layout: 'grid' | 'matrix', // 1D grid wrap or 2D dimension matrix
columns: 3, rows: 2, gap: 12, padding: 8,
sharedYAxis: true, sharedCategoryAxis: true, // synchronize scales & category domain slots
outerAxesOnly: true, // hide redundant inner column/row tick labels
border: true, borderColor: '#e2e8f0', panelBackground: '#ffffff',
headerAlignment: 'left' | 'center' | 'right', headerPosition: 'top' | 'bottom',
headerFontSize: 12, headerColor: '#475569',
},
}legend.show: 'auto' shows a legend when there are two or more series, and hides it for one series because the title already says what is plotted.
animation controls motion. On the first render, charts grow in. When the data changes (a filter, a slicer or a selection), each data point moves from where it was to its new place, matched by its identity (category, series). Points that are new fade in. Lines and areas morph when their shape allows it. duration is in milliseconds. Users with prefers-reduced-motion get no animation. Exports always capture the final state.
Visual-specific sections #
// combo chart (lineClusteredColumn) with dual Y-axes and axis titles
format: {
valueAxis: { title: 'Revenue ($)', displayUnits: 'auto' },
secondaryValueAxis: {
show: true,
title: 'Margin %',
mode: 'auto' | 'on' | 'off', // 'auto' detects scale difference, 'on' forces secondary axis, 'off' forces single axis
format: '0.0%',
min: 0,
max: 1,
tickCount: 5,
},
}
// card
format: { card: { labelPosition: 'top'|'bottom', showLabel: true, align: 'left'|'center', valueFontSize, upIsGood: true, deltaLabel: 'vs LY' } }
// kpi
format: { kpi: { upIsGood: true } }
// pie / donut
format: { pie: { maxSlices: 8 }, donut: { innerRadius: 0.62, centerLabel: true } }
// table
format: { table: {
totals: true, rowBanding: true, wrap: false, density: 'compact'|'normal'|'comfortable', pageSize: 200,
columnWidths: { 'Total Sales': 140 },
freezeColumns: 1, pinnedColumns: ['Category'], // sticky frozen leading columns
columnOrder: ['Category', 'Total Sales', 'Profit'], // interactive drag-and-drop column order
sparklines: {
'Total Sales': { type: 'area', markers: 'endpoints' }, // 'line' | 'column' | 'area' | 'winloss'
},
conditional: {
'Total Sales': { dataBars: { axis: true, color: '#3498db', negativeColor: '#e74c3c' } }, // bi-directional zero axis
'Total Margin': { dataBars: { barOnly: true } }, // hides number, displays visual bar only
'Margin %': { background: true, fontColor: true }, // cell background and text font color scales
'YoY %': { icons: true }, // ▲ ▼ ● by sign
'Profit': { rules: [{ op: '<', value: 0, color: '#d03b3b' }, { op: 'between', value: 0, value2: 1000, background: '#fff4d6' }] },
},
} }
// matrix
format: { matrix: {
expandAll: false, columnTotals: true,
stepped: false, // false = dedicated column per row hierarchy level (Power BI tabular style)
sparklines: {
'Total Sales': { type: 'line', markers: 'minmax' }, // 'line' | 'column' | 'area' | 'winloss'
},
virtualize: undefined, // auto above 500 visible rows
conditional: { /* as table */ },
} }
// slicer
format: { slicer: {
style: 'list' | 'dropdown' | 'tiles' | 'between' | 'relative' | 'slider', // dates default to 'between'; 'slider' = one value (what-if)
single: false, search: true, selectAll: true, orientation: 'horizontal', placeholder: 'All',
relative: { anchor: 'last'|'next'|'this', n: 30, unit: 'days'|'weeks'|'months'|'years', includeToday: true },
} }
// text
format: { text: { content: '# Heading\n**{{Total Sales}}** this period. [Docs](https://example.com)' } }
// waterfall
format: { waterfall: { showTotal: true, totalLabel: 'Total', increaseColor, decreaseColor, totalColor } }
// decomposition tree
format: { decomposition: { maxNodes: 10, aiSplits: true, columnWidth: 190 } }
// histogram
format: { histogram: { bins: 20, binWidth: 50 } }
// bullet
format: { bullet: { bands: [0.6, 0.85, 1], sharedScale: true } }
// maps (bubble and filled)
format: { map: {
boundaries: 'world', // or 'usStates': built-in outlines, after import '@prismbi/prismbi/geo'
geojson: featureCollection, // or your own outlines
featureKey: 'name', // property (or list) matched against the location field
legend: 'classes', classes: 5, // filled maps: quantile classes instead of a gradient
cluster: { radius: 40 }, // bubble maps: group nearby bubbles; click or Enter zooms in
tiles: 'https://tiles.example.com/{z}/{x}/{y}.png', attribution: '© provider', // optional raster basemap
maxRadius: 28, zoom: true, graticule: true,
} }
// scatter: force a renderer (auto: SVG, canvas above 3,000 points, WebGL above 50,000)
format: { scatter: { renderer: 'auto' | 'svg' | 'canvas' | 'webgl' } }
// heatmap and calendar: canvas above 3,000 cells (auto), with the same tooltips, selection and drill; SVG without a 2D canvas
format: { heatmap: { renderer: 'auto' | 'svg' | 'canvas' } }
format: { calendar: { renderer: 'auto' | 'svg' | 'canvas' } }
// slicer sync group (any style)
format: { slicer: { syncGroup: 'year' } }Header actions #
Hovering or focusing a visual shows its header icons:
- ⤢ Focus mode fills the page. Esc exits.
- ▦ Show as table displays the query result as a table.
-
⇩ Export opens a menu: data (CSV, TSV, JSON, or Excel XLSX), image (PNG at 2×), image (SVG), and Copy image (writes PNG directly to system clipboard). The same is available in code as
report.visual(id).exportCsv(),.exportXlsx(),.exportImage('png' | 'svg'),.copyImage()and.toSvg(). -
ℹ Visual tooltip / details shows a descriptive methodology or info popover card (
format.header.tooltip). - ↑ Drill up, ⇊ Go to next level and ⤓ Expand all down one level appear when a drillable role has several fields.
- ⌫ Clear selections appears on slicers.
Each of these can be turned off through format.header.
Interactive table sorting & column reordering #
-
Tri-state column sorting: Clicking any table or matrix header cycles through
ascending→descending→none(clearing sort back to natural query order). -
Multi-column sorting: Shift+clicking headers adds secondary and tertiary sort criteria, with sort priority badges (
1,2) and directional arrows (↑/↓). - Column reordering: Click and drag column header handles to rearrange column positions.
-
Quick search: Enable
format.table.search: trueorformat.matrix.search: trueto surface an integrated search input with instant substring filtering and matching row counts.
Error bars #
Add errorLower and/or errorUpper measure roles to continuous line or scatter charts to display vertical whiskers with caps, automatically extending axis bounds to prevent clipping:
{
type: 'line',
fields: {
category: 'Date[MonthNumber]',
values: 'Total Sales',
errorLower: 'Sales Lower Bound',
errorUpper: 'Sales Upper Bound',
},
}Accessibility #
Marks are focusable (Tab), and Enter or Space selects one. Tooltips also show on focus. Each chart has an aria-label from its title, and tables use real <table> markup with aria-sort. Animations respect prefers-reduced-motion.
Forecast #
Line and area charts with a date or number axis can extend each series (up to three) with a forecast:

{ type: 'line', fields: { category: 'Date[Date]', values: 'Total Sales' },
format: { analytics: { forecast: { periods: 30, confidence: 0.95, seasonality: 'auto' } } } }-
Model: damped additive Holt-Winters. Its parameters are chosen by one-step-ahead error, and the season length is detected by autocorrelation, or given as a number, or turned off with
'none'. - Display: the forecast is a dashed line inside a shaded prediction interval that widens with the horizon.
- Non-negative series: a series that has never been negative (sales, counts) is never forecast below zero.
- Dates: future dates follow the calendar for monthly, quarterly and yearly data.
Anomaly detection #
Line charts can automatically detect and highlight statistical outliers and unexpected deviations across continuous time series:
{
type: 'line',
fields: { category: 'Date[Date]', values: 'Total Sales' },
format: {
analytics: {
anomalies: {
enabled: true,
sensitivity: 1.5, // IQR multiplier (default 1.5) or z-score threshold (default 2.5)
method: 'iqr', // 'iqr' (interquartile range, default) or 'zscore'
color: '#ef4444', // custom beacon color (default: theme bad alert color)
detrend: true, // detrend series via regression to avoid false positives on trends
},
},
},
}-
Visual Outlier Beacons: Anomalous marks are rendered with halo rings and beacon dots (
.pbi-anomaly-beacon,.pbi-anomaly-ring). - Smart Detrending: The series is detrended via least-squares linear regression so genuine departures are flagged without penalizing points on natural growth or seasonal trends.
-
Interactive Tooltip Badges: Hovering over an anomaly data point appends an outlier badge with exact deviation metrics (e.g.
⚠️ Total Sales (Outlier): High (+2.4x IQR above expected)orLow (-3.1σ from expected)).
Network graph #
Visualizes entity topologies, communication links, infrastructure, and relational flows with an interactive force-directed physics simulation:
{
type: 'network',
fields: {
source: 'Topology[From]',
target: 'Topology[To]',
values: 'Topology[Bandwidth]',
group: 'Topology[Cluster]',
size: 'Topology[Importance]',
},
format: {
colors: {
categories: {
'Gateway-1': '#ff0055', // Override specific node color
'Core': '#34495e', // Override cluster group color
},
rules: [
{ op: '>=', value: 4, color: '#e74c3c' }, // Highlight bottleneck/hub nodes
{ op: '<', value: 2, color: '#2ecc71' }, // Peripheral nodes
],
gradient: { min: '#3498db', max: '#e74c3c' }, // Or smooth gradient across node metric
},
network: {
nodeSize: 9, // base radius
linkWidth: 1.5, // link line width
repulsion: 120, // node-to-node repulsion
gravity: 0.05, // centering pull
arrows: true, // directional arrowheads
labels: true, // node text labels
metric: 'degree', // metric for rules/gradient: 'degree' | 'size' | 'inWeight' | 'outWeight'
edgeColor: '#bdc3c7', // custom edge stroke color
edgeWidthRange: [1.5, 8], // weight-scaled edge stroke width [min, max]
},
},
}- Interactive Physics: Physics-based numerical relaxation with Coulomb repulsion and Hooke spring attraction places interconnected clusters naturally.
- Node Dragging: Click and drag any node to pin or adjust layout in real-time with automatic edge tracking.
-
Conditional Formatting & Highlighting: Supports rule-based threshold coloring (
colors.rules), smooth metric gradients (colors.gradient), and category-specific overrides (colors.categories) for both individual node IDs and cluster groups. -
Custom Edge Scaling: Configurable edge stroke color (
network.edgeColor) and dynamic weight scaling bounds (network.edgeWidthRange). - Cluster Highlighting: Hovering over a node highlights adjacent connections in the node's color and dims non-neighboring nodes.
- Cross-Filtering: Clicking any node cross-filters all downstream visuals in the report.
Error bars #
Clustered column and bar charts with a single series accept two optional measure roles, Error bars: lower (errorLower) and Error bars: upper (errorUpper):

{ type: 'clusteredColumn', fields: { category: 'Product[Category]', values: 'Avg Price', errorLower: 'Price P10', errorUpper: 'Price P90' } }- Drawing: each bar gets a whisker with caps between the two bounds. With only one bound, the whisker runs from the bar's value to that bound.
- Axis: the value axis grows to include the bounds.
- Tooltip: shows the range.
Maps and built-in boundaries #
| Filled map (classes) | Bubbles at country centres | Clusters |
|---|---|---|
![]() | ![]() | ![]() |
@prismbi/prismbi/geo adds world countries and US states (Natural Earth 1:110m, public domain) as an optional entry. The data is about 60 KB gzipped, and you only pay for it when you import it:
import '@prismbi/prismbi/geo';
{ type: 'filledMap', fields: { location: 'Region[Country]', values: 'Total Sales' }, format: { map: { boundaries: 'world', legend: 'classes' } } }
{ type: 'map', fields: { location: 'Region[Country]', size: 'Total Sales' }, format: { map: { boundaries: 'world' } } } // bubbles at country centres
{ type: 'filledMap', fields: { location: 'Store[State]', values: 'Orders' }, format: { map: { boundaries: 'usStates' } } }-
Matching:
-
Countries match on name, long name, or ISO alpha-2 or alpha-3 code (
France,FR,FRA). Common variants likeUSA,UKandCzech Republicwork too. -
States match on name, postal code or ISO 3166-2 code (
Texas,TX,US-TX). - Locations that don't match are left out.
-
Countries match on name, long name, or ISO alpha-2 or alpha-3 code (
- Framing: filled maps with built-in boundaries zoom to the regions that have data.
-
Your own regions:
registerGeoJson(name, geojson, keys?)(orregisterBoundaries) registers arbitrary GeoJSON feature collections (e.g. custom sales territories, school districts, postal zip codes) under a named identifier. Helper functionshasBoundaries,listBoundaries,removeBoundaries,worldCountries,usStates,featureCentroid,clusterPointsandquantileBreaksare exported from@prismbi/prismbi/geo. - Clustering: clusters are recomputed as you zoom. Each cluster shows its count, and its tooltip lists the total and some of its locations. Click a cluster, or press Enter on it, to zoom in.
Calendar heatmap #
type: 'calendar' draws one square per day, with weeks as columns and weekdays as rows, and one band per year. It's coloured on the theme's sequential ramp, or by format.colors.gradient and rules.

{ type: 'calendar', fields: { date: 'Date[Date]', values: 'Total Sales' } }- Labels: month names collapse to initials when space is tight, and weekday labels appear when the cells are large enough.
- Interaction: clicking a day cross-filters the page like any data point.
Sunburst #
type: 'sunburst' shows a hierarchy as rings, the first level innermost. Each ring is evaluated at its own level, like a matrix's subtotals, so ratios such as a margin stay right; children split their parent's angle by value. Labels follow the arc and turn along the radius on narrow slices. The total sits in the middle, and clicking any ring selects that level (a category, or a category and subcategory).

import { createVisual } from '@prismbi/prismbi';
return createVisual(el, {
model,
type: 'sunburst',
title: 'Sales by category and subcategory',
fields: { category: ['Product[Category]', 'Product[Subcategory]'], values: 'Total Sales' },
});Scorecard (goals) #
type: 'scorecard' tracks goals: each measure in Goals gets its current value, target, progress, a status and a trend sparkline. With a Trend axis, the current value is the latest point that has one (like a goal check-in); without it, the total.

-
Targets: a measure in Targets, paired with the goals in order, or a fixed
targetper goal. -
Status: progress = value ÷ target (target ÷ value for
direction: 'down', such as costs). At least 100% is On track, fromatRisk(default 90%) At risk, below that Behind.goalStatus(value, target, goal)applies the same rules, for alerts or exports. - Columns: owner and due date appear when a goal has them; narrow tiles drop due, owner, trend, target and then progress, keeping the goal, its value and status.
import { createVisual } from '@prismbi/prismbi';
return createVisual(el, {
model,
type: 'scorecard',
fields: { values: ['Total Sales', 'Margin %'], targets: ['Sales Target'], trend: 'Date[MonthYear]' },
filters: [{ target: 'Date[Year]', op: 'eq', value: 2025 }],
format: { scorecard: { goals: { 'Margin %': { target: 0.42, owner: 'Finance', due: '2025-12-31' } } } },
});Gantt chart #
Gantt charts display scheduled activities, work packages, and milestones across a calendar timeline. Tasks are laid out on a vertical band scale with start and end dates mapped across a continuous time scale. Bars show progress completion fills, and zero-duration tasks automatically render as milestone diamonds.
createVisual(el, {
model,
type: 'gantt',
fields: {
task: 'Tasks[TaskName]',
start: 'Tasks[StartDate]',
end: 'Tasks[EndDate]',
progress: 'Tasks[ProgressPercent]',
},
});Candlestick (OHLC & Volume) #
Candlestick charts visualize financial asset price action and securities trading. Each interval displays open, high, low, and close prices:
- Upward sessions (close >= open) render in theme accent/green.
- Downward sessions (close < open) render in warning/red.
- Optional bottom volume bars provide trading liquidity context.
createVisual(el, {
model,
type: 'candlestick',
fields: {
category: 'Stocks[TradingDay]',
open: 'Stocks[OpenPrice]',
high: 'Stocks[HighPrice]',
low: 'Stocks[LowPrice]',
close: 'Stocks[ClosePrice]',
volume: 'Stocks[VolumeTraded]',
},
});Chord diagram #
Chord diagrams visualize multi-entity flows, cross-departmental transfers, and bidirectional migrations arranged radially along a circular perimeter:
- Peripheral arcs represent each entity with length proportional to total volume (inflow + outflow).
- Interior quadratic Bézier ribbons connect source and destination entities, with ribbon width proportional to flow volume.
- Interactive cross-filtering on node click; hover reveals exact directional volumes.
createVisual(el, {
model,
type: 'chord',
fields: {
source: 'Transfers[FromRegion]',
target: 'Transfers[ToRegion]',
values: 'Transfers[Volume]',
},
});Axis zoom #
format.categoryAxis.zoom: true adds a range slider under line and area charts. Dragging its thumbs narrows the visible part of the axis, and Reset shows everything again. The zoom is view state kept per visual, so it doesn't change filters or re-query.

Try it #
import { createVisual } from '@prismbi/prismbi';
return createVisual(el, {
model,
type: 'waterfall',
title: 'Change vs last year by category',
fields: { category: 'Product[Category]', values: 'Sales Change' },
filters: [{ target: 'Date[Year]', op: 'eq', value: 2025 }],
});On the docs site (npm run docs), ▶ Run in playground opens it in an editor next to its output.

