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:

Every built-in visual with the demo data (light theme). The same images back the visual regression tests.

area areaboxPlot boxPlotbullet bullet
calendar calendarcard cardclusteredBar clusteredBar
clusteredColumn clusteredColumndecompositionTree decompositionTreedonut donut
funnel funnelgauge gaugeheatmap heatmap
histogram histogramkpi kpiline line
lineClusteredColumn lineClusteredColumnmap mapmatrix matrix
multiRowCard multiRowCardpercentStackedBar percentStackedBarpercentStackedColumn percentStackedColumn
pie pieradar radarribbon ribbon
sankey sankeyscatter scatterscatter-webgl scatter-webgl
slicer-list slicer-listslicer-range slicer-rangeslicer-tiles slicer-tiles
stackedArea stackedAreastackedBar stackedBarstackedColumn stackedColumn
table tabletext texttreemap treemap
waterfall waterfallsunburst sunburstscorecard scorecard
filledMap filledMapcolumn-error-bars column-error-barsline-forecast line-forecast
gantt ganttcandlestick candlestickchord chord
network network

Catalogue #

Type (aliases)RolesNotes
clusteredColumn (column)category* (drillable, multiple) · legend · values* (multiple) · smallMultiplesSorted by first value, descending, unless the category is a number, a date or has sort-by
stackedColumn, percentStackedColumnsame2 px gaps between segments. Categories sorted by total
clusteredBar (bar), stackedBar, percentStackedBarsameHorizontal versions
linecategory* (drillable) · legend · values* · smallMultiplesCrosshair tooltip, end labels (four or fewer series), markers (16 or fewer points), cross-highlight
area, stackedAreasame10% area wash. Stacked area sums series
lineClusteredColumn (combo)category* · legend (columns) · values (columns) · lineValuesDual-axis or shared value axis. Configurable secondary Y-axis (format.secondaryValueAxis), primary/secondary axis titles, and column data labels
waterfallcategory* (drillable) · values*Running total with connectors, increase / decrease / total colours, optional total bar
pie, donutlegend* (drillable) · values*Folds slices past the palette into "Other". Donut shows a centre total
treemapcategory* (drillable) · values*Squarified layout
scorecard (goals)values* (goals, multiple) · targets (paired with values in order) · trendCurrent value (the latest trend point, else the total), target, progress, status and sparkline per goal; settings in format.scorecard.goals
sunburstcategory* (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
funnelcategory* · values*Shows % of first stage
scatter (bubble)details* · legend · x* · y* · sizeBubble area ∝ size. Cross-highlight, trend line
heatmaprows* · 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
histogramvalues* (numeric column) · weight (optional measure)Bins by Sturges' rule or format.histogram.bins / binWidth
boxPlotcategory · values* (numeric column)Quartiles, 1.5 × IQR whiskers, outliers, mean marker
bulletcategory · value* · target · maximumValue bar over qualitative bands with a target tick
radarcategory* (spokes, 3 or more) · legend · values*One polygon per series on a shared radial scale
sankeysource* · target* · values*Multi-stage flows (a target that is also a source becomes a middle column)
ribboncategory* · legend* · values*Stacked by rank in each column, with ribbons showing rank changes
map (bubbleMap)location* · legend · latitude · longitude · sizeColumns 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
cardvalue* · deltaAuto-sized callout value, signed delta with good/bad colour
multiRowCardcategory · values*One card per group
kpitrend · value* · targetHeadline is the last trend point. Shows % vs goal and a sparkline
gaugevalue* · min · max · target180° radial gauge with multi-tier threshold zones (format.gauge.thresholds) and optional tapered needle (format.gauge.needle)
tablecolumns* (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
matrixrows (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)
slicerfield* (several fields give a hierarchy tree)list · dropdown · tiles · between · relative date · tree. Sync groups across pages
gantttask* · start* · end · progress · resourceProject schedule timeline with progress fills and milestone diamonds
candlestickcategory* · open* · high* · low* · close* · volumeFinancial OHLC stock chart with wicks, bodies and bottom volume bars
chordsource* · target* · values*Circular relationship flows and inter-entity transfers with quadratic ribbons
networksource* · target* · values · group · sizeForce-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:

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:

Each of these can be turned off through format.header.

Interactive table sorting & column reordering #

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:

A line chart with a forecast band

{ type: 'line', fields: { category: 'Date[Date]', values: 'Total Sales' },
  format: { analytics: { forecast: { periods: 30, confidence: 0.95, seasonality: 'auto' } } } }

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
      },
    },
  },
}

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]
    },
  },
}

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):

A column chart with error bars

{ type: 'clusteredColumn', fields: { category: 'Product[Category]', values: 'Avg Price', errorLower: 'Price P10', errorUpper: 'Price P90' } }

Maps and built-in boundaries #

Filled map (classes)Bubbles at country centresClusters
Filled world mapBubble map by countryClustered bubble map

@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' } } }

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.

A calendar heatmap of daily sales

{ type: 'calendar', fields: { date: 'Date[Date]', values: 'Total Sales' } }

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).

A sunburst of sales by category and subcategory

▶ Run in playground
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.

A scorecard with three goals

▶ Run in playground
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:

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:

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.

A line chart with a zoomed category axis

Try it #

▶ Run in playground
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.