Skip to main content

KPI Dashboard

What is a KPI dashboard?​

A KPI dashboard is a single screen that shows an organisation's key performance indicators (the few measures that show whether a goal is being met), each against a target or an earlier period, so people can see at a glance what is on track and what needs attention. Sales, finance, operations and support teams each use their own.

A sales KPI dashboard on a dark navy background: four tiles for revenue, gross margin, orders and average order value, each with its change against target and a 12-month sparkline, gross margin flagged as off target; below them monthly revenue columns with dashed target and last-year lines, a bullet chart of revenue by region against target, and a waterfall of the revenue gap by region

A sales KPI dashboard for one quarter, with off-target values in orange (simulated data). Try the interactive version and change the period, comparison and region.

Key takeaways
  • A KPI is a metric with a goal, a target, an owner and a clear action when it moves. Most metrics are not KPIs.
  • Every number on a KPI dashboard needs a comparison: against target, the previous period or a forecast.
  • Pick the chart by the question: a big number with a sparkline for status and trend, a bullet chart for progress to target, a waterfall for why a number changed.
  • Put the most important KPI top-left, group related measures, and never rely on red and green alone.
  • Match the refresh rate to how fast people can act: daily or hourly for most business KPIs.

KPI vs metric​

Every KPI is a metric, but few metrics deserve to be KPIs. A metric is anything you can count or measure: website visits, calls made, tickets closed. A key performance indicator (KPI) is a metric chosen because it tracks progress towards a specific goal. To earn the name, it should have:

  • a goal it serves ("grow recurring revenue 20% this year");
  • a target for each period, so a value can be judged good or bad;
  • an owner, who is expected to act when it moves;
  • a clear definition: what is counted, from which system, over which period.

"Website visits" is a metric. "Qualified leads per month, target 400, owned by the marketing lead" is a KPI.

Leading vs lagging indicators​

Lagging indicatorLeading indicator
What it measuresAn outcome that has already happenedAn activity or condition that tends to come before the outcome
ExamplesRevenue, profit, customer churn, on-time deliveryPipeline value, demos booked, trial sign-ups, machine downtime alarms
StrengthEasy to measure, hard to argue withGives time to act before the outcome is fixed
WeaknessArrives too late to change this periodIts link to the outcome is a prediction, which can fail

A good KPI dashboard pairs the two: revenue (lagging) next to the pipeline that will become next quarter's revenue (leading). Kaplan and Norton's balanced scorecard is built on the same idea, balancing financial results with customer, internal-process, and innovation and learning measures (later renamed learning and growth) that drive future results.

How to choose KPIs for a dashboard​

Choose KPIs by starting from the decisions the dashboard's readers make, and keep only the measures that would trigger one of them.

  1. Write down the goal and who reads the dashboard. A board, a sales manager and a shift supervisor need different screens.
  2. List the decisions those readers make, such as "move sales effort to a weaker region" or "call in maintenance".
  3. For each decision, find the measure that would trigger it. That measure is a KPI candidate.
  4. Test each candidate. Is it specific and measurable from data you trust? Can the owner influence it? Does it have a time frame and a realistic target? These are the SMART criteria (specific, measurable, assignable, realistic, time-related) from Doran's 1981 paper on setting objectives; later versions often read "achievable" for "assignable".
  5. Keep one or two leading indicators for each lagging one.
  6. Cut the list to what fits on one screen. Move the rest to a detail page.
  7. Write each KPI's definition and target down, and review them every quarter.

Types of KPI dashboard​

Dashboards are usually grouped by who uses them and how often, following Stephen Few's split into strategic, analytical and operational dashboards.

TypeWho reads itHow oftenWhat it showsTypical charts
Strategic (executive)Leadership, boardWeekly to quarterlyA few company-level KPIs against annual targetsBig numbers with sparklines, bullet charts, a trend per KPI
OperationalTeam leads, supervisors, support desksLive to dailyActivity and status that need action todayBig numbers, gauges, current-value bars, alert lists
AnalyticalAnalysts, managersAd hocCauses and patterns behind the KPIs, with filters and drill-downLine and bar charts, waterfalls, scatter plots, heatmaps

Some guides add a tactical dashboard between strategic and operational, used by department managers to track monthly progress on a plan. Most real dashboards blend types: a sales dashboard is strategic in its top row and analytical underneath.

Which chart to use for each KPI​

Choose the chart by the question the reader asks of that number.

QuestionChartWhy it works
Where are we now, and which way is it heading?Big number with a sparklineThe value is read at a glance; the sparkline shows the trend in the space of a line of text
How close are we to target?Bullet chartValue, target and good/poor bands in one compact bar, easy to stack and compare
Is one live value inside its limits?GaugeFamiliar, with coloured zones; best kept for one or two values that are watched live
How has it changed over time, against plan?Line chart or columns, with target and last-year linesShows trend, seasonality and the gap to plan month by month
How do regions, products or people compare?Bar chart, sortedLengths on a common baseline are the easiest thing to compare
Why did the number change?Waterfall chart (variance bridge)Splits the gap between plan and actual into the parts that caused it
Where do we lose people in a process?Funnel chartShows how many reach each stage of a sales or sign-up process
Which days, hours or sites stand out?Calendar heatmapColour shows patterns over many days or many sites at once

Bullet chart vs gauge​

Both show a value against a target and bands. A gauge needs a large circle to show one number, its arc is harder to read precisely than a straight bar, and several gauges side by side are hard to compare. A bullet chart, designed by Stephen Few for dashboards, shows the same information in a thin bar, and five of them stack in the space of one gauge on a shared scale. Use bullet charts for a list of KPIs against targets. Keep gauges for the one or two values an operator watches live, where the dial shape is quicker to recognise.

Comparisons and targets​

A number on its own tells you little. "$4.00M revenue" could be a record quarter or a bad one. Every KPI on the dashboard needs at least one comparison.

Compare withAnswersWatch out for
Target or budgetAre we on plan?Targets set too low or too high make every value look good or bad
The previous periodAre we improving?Seasonality: December is usually busier than November for a retailer
The same period last yearAre we growing, allowing for the season?Calendar effects such as extra trading days or a moved holiday
ForecastWhere will we land if things continue?A forecast is an estimate; label it and show its range if you can
Peers or benchmarksHow do we compare with others?Definitions often differ between teams and companies

Show the comparison as a difference with a direction, such as "▲ +1.2% vs target", rather than as a colour alone.

Worked example: percent vs percentage points​

In the interactive dashboard, the fourth quarter for all regions shows:

KPIActualTargetLast yearvs targetvs last year
Revenue$4.00M$3.96M$3.67M+1.2%+9.1%
Gross margin46.1%47.4%45.8%−1.3 points+0.3 points

Revenue is on target and well up on last year. Gross margin is 1.3 percentage points below target, which is a 2.7% shortfall in relative terms (1.3 ÷ 47.4). Write the change of a rate in points ("pts") so readers don't confuse the two. "Margin down 1.3%" would suggest a much smaller miss than the 2.7% it really is.

KPI dashboard design​

A good KPI dashboard puts the most important number top-left, shows every KPI against a target or earlier period, and keeps detail lower down the screen.

A wireframe of a KPI dashboard in four zones: headline KPI tiles across the top, with the most important one top-left; a trend against target below; a breakdown and a variance chart side by side at the bottom; and a dashed scan path running across the top and then down the left. Beside it, one KPI tile enlarged, labelled with its name and period, value, comparison with a symbol, status in words, target line and 12-month sparkline

  • Most important top-left. Readers of left-to-right languages tend to start at the top-left; on pages they scan rather than read, the Nielsen Norman Group found an F-shaped pattern across the top and down the left side. Put the KPI that matters most there.
  • Overview, then detail. Headline tiles first, the trend below, then breakdowns and variance. Each row should explain the row above it.
  • Group related KPIs. Keep revenue next to the pipeline that feeds it, and output next to downtime. Use space and alignment to show the groups, not heavy borders.
  • One period everywhere. Every number on the screen should cover the same period unless it says otherwise, and the period should be visible ("Q4", "last 30 days").
  • Consistent scales and units. Use the same currency format, decimal places and axis ranges across similar charts, and start bar axes at zero.
  • Colour with care. Use a calm palette for normal values and keep one strong colour for exceptions. About 1 in 12 men and 1 in 200 women have a colour vision deficiency, most often affecting red and green, so pair colour with a symbol (▲▼) or a word ("Off target"), as the WCAG "use of colour" rule asks. Blue and orange, as in the demo, stay distinct for most of them.
  • Show freshness. Label when the data was last updated, so nobody acts on yesterday's numbers by mistake.

KPI dashboard examples​

Each team's dashboard has its own headline KPIs, and each KPI suits a particular kind of chart.

TeamHeadline KPIsCharts that suit it
SalesRevenue or bookings vs quota, pipeline value and coverage, win rate, average deal size, sales cycle lengthBullet charts by rep or region, pipeline funnel, revenue trend vs target
MarketingQualified leads, cost per lead, conversion rate by stage, customer acquisition cost, return on ad spendFunnel, trend lines by channel, bars by campaign
OperationsOn-time delivery, order cycle time, backlog, utilisationBig numbers with sparklines, control limits on a line chart, current-value bars
FinanceRevenue, gross and operating margin, cash runway, days sales outstanding, budget varianceWaterfall (variance bridge), trend vs budget, bullet charts by cost centre
ManufacturingOverall equipment effectiveness (OEE = availability × performance × quality), scrap rate, downtime by cause, output vs planBullets or gauges for OEE, a Pareto chart of downtime causes, a live HMI screen for output
IT and service deskUptime, incident count, mean time to resolve, tickets breaching service levels, customer satisfactionBig numbers, heatmaps by hour and service, trend lines

What goes on a sales dashboard?​

A sales dashboard answers three questions: will we hit the number this period, where is the gap, and what will next period look like? The top row shows revenue (or bookings) against quota, with how much of the period has passed. Beneath it, a bullet chart compares each region or salesperson with their own target, a waterfall shows which ones explain the gap, and the pipeline by stage shows whether next quarter is covered. Activity measures such as calls and demos are leading indicators; keep them, but below the outcomes.

How often should a KPI dashboard refresh?​

As often as someone can act on the change, and no faster. Most strategic KPIs move monthly, so a daily refresh is plenty. Sales and operations dashboards are often refreshed hourly or every few minutes. Where people act within seconds (a production line, a network, a trading desk), the dashboard needs streaming data and charts built for it. Our real-time dashboard guide covers update rates, data paths and which charts work live.

Common KPI dashboard mistakes​

Most KPI dashboards fail by showing too much, or by showing numbers that can't be judged or acted on.

  • Too many KPIs. When thirty numbers are all labelled key, readers can't tell which one to act on first, and the screen needs scrolling.
  • Vanity metrics. Followers, page views and total sign-ups since launch only go up and rarely lead to a decision. Prefer rates and measures with a target.
  • No targets or comparisons. A value without a target or an earlier period can't be judged, so readers guess.
  • Gauges everywhere. A wall of dials wastes space and makes comparison hard.
  • Mixed periods. Month-to-date revenue beside a year-to-date margin and a rolling 30-day churn invites wrong conclusions. Use one period, or label each clearly.
  • Colour as the only signal. Red and green alone fail for many colour-blind readers, and on poor screens and greyscale prints.
  • Truncated or inconsistent axes. A bar axis that starts at 95% makes a 2% miss look like a collapse.
  • Targets that become the goal. When a measure becomes a target, people learn to move the number rather than the outcome (Goodhart's law). Pair each KPI with a check on quality, such as revenue with margin or tickets closed with satisfaction.

How to build a KPI dashboard in JavaScript, React or Angular​

The example below is a sales dashboard for a made-up company with four regions and three product lines. Every time you change a filter it recalculates four KPI tiles with sparklines, a revenue trend against target, a bullet chart by region and a variance waterfall from a year of simulated monthly data.

Use Period to show December, the fourth quarter or the whole year, and Compare to to judge every KPI against the target or last year. Region filters the tiles, trend and waterfall to one region; the waterfall then splits the gap by product line instead. Highlight off-target KPIs turns the orange flags (more than 2% below the comparison) on and off, so you can compare how clearly the problems stand out with and without them. Hover the charts for values, scroll to zoom, drag to pan and double-click to reset.

Here is the code for this dashboard. The KPI calculations and the controls are plain JavaScript; SciChart.js draws the sparklines, the trend, the bullet chart and the waterfall. The React and Angular versions show the core of it: the monthly revenue trend against target, with off-target months coloured.

// A sales KPI dashboard with SciChart.js: KPI tiles with sparklines, a revenue trend against target and last year,
// a bullet chart of revenue by region and a waterfall of the variance, all driven by the same filters
const {
SciChartSurface,
SciChartSubSurface,
NumericAxis,
NumberRange,
Rect,
Thickness,
EAutoRange,
EAxisAlignment,
ETextAlignment,
ECoordinateMode,
EAnnotationLayer,
EHorizontalAnchorPoint,
EVerticalAnchorPoint,
EColumnMode,
EColumnYMode,
EDataPointWidthMode,
EFillPaletteMode,
EStrokePaletteMode,
FastLineRenderableSeries,
FastColumnRenderableSeries,
FastRectangleRenderableSeries,
XyDataSeries,
XyxyDataSeries,
TextLabelProvider,
BoxAnnotation,
TextAnnotation,
HorizontalLineAnnotation,
WaveAnimation,
parseColorToUIntArgb,
SciChartJsNavyTheme,
CursorModifier,
LegendModifier,
ELegendOrientation,
ELegendPlacement,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"

// Blue for on target and orange for off target: a pair that colour-blind readers can tell apart.
// Every status also has a symbol and a word, so colour is never the only clue.
const ON = "#50C7E0";
const OFF = "#FF8A3D";
const NEUTRAL = "#B8C6DD";
const OFF_TARGET_BELOW = 0.98; // below 98% of the comparison counts as off target
const PERIOD_MONTHS = { month: [11], quarter: [9, 10, 11], year: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] };
const state = { period: "quarter", compare: "target", region: "all", highlight: true };

// Add up orders, revenue and gross profit for the records that match a filter
const totals = (keep) => {
const sum = { actual: { orders: 0, revenue: 0, gross: 0 }, lastYear: { orders: 0, revenue: 0, gross: 0 }, target: { orders: 0, revenue: 0, gross: 0 } };
for (const record of records) {
if (!keep(record)) continue;
for (const kind of ["actual", "lastYear", "target"]) {
for (const measure of ["orders", "revenue", "gross"]) sum[kind][measure] += record[kind][measure];
}
}
return sum;
};
const inRegion = (record) => state.region === "all" || record.region === Number(state.region);
const inPeriod = (record) => PERIOD_MONTHS[state.period].includes(record.month);
const money = (k) => (k >= 1000 ? `$${(k / 1000).toFixed(2)}M` : `$${Math.round(k)}k`);
const axisMoney = (k) => {
const size = Math.abs(k);
const text = size >= 1000 ? `$${(size / 1000).toFixed(1)}M` : size < 0.5 ? "$0" : `$${Math.round(size)}k`;
return k < -0.5 ? `−${text}` : text;
};

// The four KPIs. Each is worked out from the totals, so it can be compared with the same KPI for the target or last year.
const KPIS = [
{ name: "Revenue", of: (s) => s.revenue, format: money },
{ name: "Gross margin", of: (s) => (100 * s.gross) / s.revenue, format: (v) => `${v.toFixed(1)}%`, isPercent: true },
{ name: "Orders", of: (s) => s.orders, format: (v) => Math.round(v).toLocaleString("en-US") },
{ name: "Average order value", of: (s) => (1000 * s.revenue) / s.orders, format: (v) => `$${Math.round(v).toLocaleString("en-US")}` }
];
const surfaceOptions = (title) => ({
theme: new SciChartJsNavyTheme(),
title,
titleStyle: { fontSize: 14, color: "#E8EDF5", alignment: ETextAlignment.Left, placeWithinChart: false }
});
const zoomAndCursor = (tooltipDataTemplate = undefined) => [
new CursorModifier({ showTooltip: true, showAxisLabels: false, tooltipDataTemplate }),
new MouseWheelZoomModifier(),
new ZoomPanModifier(),
new ZoomExtentsModifier()
];

// ---- KPI tiles: one chart with four sub-charts, each a tile with a sparkline of the last 12 months ----
const tileChart = await SciChartSurface.create(ui.sparkRow, { theme: new SciChartJsNavyTheme() });
tileChart.sciChartSurface.background = "#1B2438";
const sparklines = [];
for (const [i, kpi] of KPIS.entries()) {
const tile = SciChartSubSurface.createSubSurface(tileChart.sciChartSurface, {
position: new Rect(0.25 * i + 0.003, 0, 0.244, 1),
padding: new Thickness(4, 6, 4, 8),
isTransparent: false
});
tile.background = "#24324F";
tile.xAxes.add(new NumericAxis(tileChart.wasmContext, { isVisible: false, visibleRange: new NumberRange(-0.5, 11.5) }));
// growBy leaves the top two-thirds of the tile empty for the text
tile.yAxes.add(new NumericAxis(tileChart.wasmContext, { isVisible: false, autoRange: EAutoRange.Always, growBy: new NumberRange(0.1, 2.1) }));
const actual = new XyDataSeries(tileChart.wasmContext, { isSorted: true, containsNaN: false });
const comparison = new XyDataSeries(tileChart.wasmContext, { isSorted: true, containsNaN: false });
tile.renderableSeries.add(
new FastLineRenderableSeries(tileChart.wasmContext, { dataSeries: comparison, stroke: "#8A9BB8", strokeThickness: 1, strokeDashArray: [3, 3] }),
new FastLineRenderableSeries(tileChart.wasmContext, { dataSeries: actual, stroke: ON, strokeThickness: 2 })
);
// Shade the months in the selected period, behind the sparkline
const periodBox = new BoxAnnotation({ x1: -0.5, x2: 11.5, yCoordinateMode: ECoordinateMode.Relative, y1: 0.64, y2: 1, fill: "#FFFFFF1A", strokeThickness: 0, annotationLayer: EAnnotationLayer.BelowChart });
tile.annotations.add(periodBox);
ui.tiles[i].name.textContent = kpi.name;
sparklines.push({ actual, comparison, periodBox });
}

// ---- Revenue trend: monthly columns, with the target and last year as lines ----
const trend = await SciChartSurface.create(ui.cells.trend, surfaceOptions(""));
const monthAxis = new NumericAxis(trend.wasmContext, {
visibleRange: new NumberRange(-0.6, 11.6),
autoTicks: false,
majorDelta: 1,
drawMajorGridLines: false,
drawMinorGridLines: false
});
monthAxis.labelProvider.formatLabel = (x) => MONTHS[Math.round(x)] ?? "";
monthAxis.labelProvider.formatCursorLabel = (x) => MONTHS[Math.round(x)] ?? "";
trend.sciChartSurface.xAxes.add(monthAxis);
const revenueAxis = new NumericAxis(trend.wasmContext, { autoRange: EAutoRange.Always, growBy: new NumberRange(0, 0.12) });
revenueAxis.labelProvider.formatLabel = axisMoney;
trend.sciChartSurface.yAxes.add(revenueAxis);
const monthly = { actual: [], target: [], lastYear: [] };
const revenueSeries = new XyDataSeries(trend.wasmContext, { dataSeriesName: "Revenue", isSorted: true, containsNaN: false });
const targetSeries = new XyDataSeries(trend.wasmContext, { dataSeriesName: "Target", isSorted: true, containsNaN: false });
const lastYearSeries = new XyDataSeries(trend.wasmContext, { dataSeriesName: "Last year", isSorted: true, containsNaN: false });
// A palette provider colours each month's column: orange when it is off target and highlighting is on
const isOffMonth = (index) => state.highlight && monthly.actual[index] < OFF_TARGET_BELOW * monthly[state.compare][index];
const offColumns = {
fillPaletteMode: EFillPaletteMode.SOLID,
strokePaletteMode: EStrokePaletteMode.SOLID,
onAttached() {},
onDetached() {},
overrideFillArgb: (x, y, index) => (isOffMonth(index) ? parseColorToUIntArgb(OFF + "CC") : undefined),
overrideStrokeArgb: (x, y, index) => (isOffMonth(index) ? parseColorToUIntArgb(OFF) : undefined)
};
trend.sciChartSurface.renderableSeries.add(
new FastColumnRenderableSeries(trend.wasmContext, {
dataSeries: revenueSeries,
fill: "#50C7E0CC",
stroke: "#50C7E0",
dataPointWidth: 0.6,
cornerRadius: 8,
paletteProvider: offColumns,
animation: new WaveAnimation({ duration: 1000 })
}),
new FastLineRenderableSeries(trend.wasmContext, { dataSeries: targetSeries, stroke: "#F6E05E", strokeThickness: 2, strokeDashArray: [6, 4] }),
new FastLineRenderableSeries(trend.wasmContext, { dataSeries: lastYearSeries, stroke: "#A7B3C9", strokeThickness: 2 })
);
const trendPeriodBox = new BoxAnnotation({ x1: -0.5, x2: 11.5, yCoordinateMode: ECoordinateMode.Relative, y1: 0, y2: 1, fill: "#FFFFFF12", strokeThickness: 0, annotationLayer: EAnnotationLayer.BelowChart });
trend.sciChartSurface.annotations.add(trendPeriodBox);
trend.sciChartSurface.chartModifiers.add(
...zoomAndCursor(),
new LegendModifier({ showCheckboxes: false, orientation: ELegendOrientation.Horizontal, placement: ELegendPlacement.TopLeft })
);

// ---- Bullet chart: the period's revenue by region, against the comparison ----
// A vertical chart: the x-axis runs down the left (one row per region) and the value axis along the bottom
const bullet = await SciChartSurface.create(ui.cells.bullet, surfaceOptions(""));
bullet.sciChartSurface.xAxes.add(
new NumericAxis(bullet.wasmContext, {
axisAlignment: EAxisAlignment.Left,
labelProvider: new TextLabelProvider({ labels: REGIONS, useNativeText: false }),
autoTicks: false,
majorDelta: 1,
drawMajorGridLines: false,
drawMinorGridLines: false,
drawMajorBands: false,
visibleRange: new NumberRange(-0.6, REGIONS.length - 0.4)
})
);
const bulletScale = new NumericAxis(bullet.wasmContext, {
axisAlignment: EAxisAlignment.Bottom,
flippedCoordinates: true, // on a vertical chart this makes the bars grow from left to right
maxAutoTicks: 5,
drawMajorGridLines: false,
drawMinorGridLines: false
});
bulletScale.labelProvider.formatLabel = axisMoney;
bullet.sciChartSurface.yAxes.add(bulletScale);
let bulletRows = [];
// One rectangle per row, spanning rowIndex ± halfHeight across the row and from `from` to `to` along the scale
const bulletLayer = (halfHeight, fill, paletteProvider = undefined) => {
const dataSeries = new XyxyDataSeries(bullet.wasmContext, { containsNaN: false });
bullet.sciChartSurface.renderableSeries.add(
new FastRectangleRenderableSeries(bullet.wasmContext, {
dataSeries,
columnXMode: EColumnMode.StartEnd,
columnYMode: EColumnYMode.TopBottom,
fill,
stroke: fill,
strokeThickness: 0,
paletteProvider
})
);
return (from, to) => {
dataSeries.clear();
dataSeries.appendRange(
bulletRows.map((_, i) => i - halfHeight),
bulletRows.map(from),
bulletRows.map((_, i) => i + halfHeight),
bulletRows.map(to)
);
};
};
// Qualitative bands, relative to each region's comparison: below 90%, 90-100%, and above
const setPoorBand = bulletLayer(0.38, "#7D8799");
const setFairBand = bulletLayer(0.38, "#A9B1BF");
const setGoodBand = bulletLayer(0.38, "#D5DAE2");
// The actual bar: dark, orange when off target, and faded for regions outside the filter
const barColour = (index) => {
const row = bulletRows[index];
const colour = state.highlight && row.ratio < OFF_TARGET_BELOW ? OFF : "#0B1A33";
const isFaded = state.region !== "all" && index !== Number(state.region);
return parseColorToUIntArgb(colour + (isFaded ? "55" : "FF"));
};
const setActualBar = bulletLayer(0.13, "#0B1A33", {
fillPaletteMode: EFillPaletteMode.SOLID,
strokePaletteMode: EStrokePaletteMode.SOLID,
onAttached() {},
onDetached() {},
overrideFillArgb: (x, y, index) => barColour(index),
overrideStrokeArgb: (x, y, index) => barColour(index)
});
const setMarker = bulletLayer(0.28, "#0B1A33");
let bulletLabels = [];
bullet.sciChartSurface.chartModifiers.add(
...zoomAndCursor((seriesInfos) => {
const info = seriesInfos.find((s) => s.isWithinDataBounds);
if (!info) return [];
const row = bulletRows[info.dataSeriesIndex];
return [row.name, `Actual: ${money(row.actual)}`, `${compareName()}: ${money(row.comparison)}`, `${Math.round(100 * row.ratio)}% of ${compareName().toLowerCase()}`];
})
);

// ---- Waterfall: how each region (or product line) adds to the gap between actual and comparison ----
const bridge = await SciChartSurface.create(ui.cells.bridge, surfaceOptions(""));
let bridgeBars = [];
const bridgeAxis = new NumericAxis(bridge.wasmContext, { autoTicks: false, majorDelta: 1, drawMajorGridLines: false, drawMinorGridLines: false, drawMajorBands: false });
bridgeAxis.labelProvider.formatLabel = (x) => bridgeBars[Math.round(x)]?.label ?? "";
bridge.sciChartSurface.xAxes.add(bridgeAxis);
const gapAxis = new NumericAxis(bridge.wasmContext, { autoRange: EAutoRange.Always, growBy: new NumberRange(0.2, 0.2), maxAutoTicks: 5 });
gapAxis.labelProvider.formatLabel = axisMoney;
bridge.sciChartSurface.yAxes.add(gapAxis);
const bridgeSeries = new XyxyDataSeries(bridge.wasmContext, { containsNaN: false });
const bridgeColour = (index) => {
const bar = bridgeBars[index];
if (!bar) return undefined;
return parseColorToUIntArgb(bar.isTotal ? "#94A3B8" : bar.change >= 0 ? ON : OFF);
};
// Colour each bar by direction: blue where revenue is ahead, orange where it is behind, grey for the total
const bridgeColours = {
fillPaletteMode: EFillPaletteMode.SOLID,
onAttached() {},
onDetached() {},
overrideFillArgb: (x, y, index) => bridgeColour(index)
};
bridge.sciChartSurface.renderableSeries.add(
new FastRectangleRenderableSeries(bridge.wasmContext, {
dataSeries: bridgeSeries,
columnXMode: EColumnMode.Mid,
columnYMode: EColumnYMode.TopBottom,
dataPointWidthMode: EDataPointWidthMode.Range,
dataPointWidth: 0.6,
strokeThickness: 0,
paletteProvider: bridgeColours
})
);
bridge.sciChartSurface.annotations.add(new HorizontalLineAnnotation({ y1: 0, stroke: "#E4F5FC", strokeThickness: 1 }));
let bridgeLabels = [];
bridge.sciChartSurface.chartModifiers.add(
...zoomAndCursor((seriesInfos) => {
const info = seriesInfos.find((s) => s.isWithinDataBounds);
const bar = info && bridgeBars[info.dataSeriesIndex];
return bar ? [bar.label, `${bar.isTotal ? "Total gap" : "Contribution"}: ${signedMoney(bar.change)}`] : [];
})
);
const signedMoney = (k) => `${k >= 0 ? "+" : "−"}${money(Math.abs(k))}`;
const compareName = () => (state.compare === "target" ? "Target" : "Last year");

// ---- Redraw everything from the current filters ----
function update() {
const months = PERIOD_MONTHS[state.period];
const periodRange = { x1: months[0] - 0.5, x2: months[months.length - 1] + 0.5 };

// KPI tiles
const period = totals((r) => inRegion(r) && inPeriod(r));
KPIS.forEach((kpi, i) => {
const tile = ui.tiles[i];
const actual = kpi.of(period.actual);
const comparison = kpi.of(period[state.compare]);
const ratio = actual / comparison;
const isOff = ratio < OFF_TARGET_BELOW;
const change = kpi.isPercent ? `${(actual - comparison).toFixed(1)} pts` : `${(100 * (ratio - 1)).toFixed(1)}%`;
tile.value.textContent = kpi.format(actual);
tile.change.textContent = `${ratio >= 1 ? "▲ +" : "▼ "}${change.replace("-", "−")} vs ${compareName().toLowerCase()}`;
tile.status.textContent = isOff ? "Off target" : "";
tile.change.style.color = !state.highlight ? NEUTRAL : isOff ? OFF : ratio >= 1 ? ON : NEUTRAL;
tile.status.style.cssText = state.highlight && isOff ? `color:#1B2438; background:${OFF}; border-radius:3px; padding:0 4px; font-weight:600` : "display:none";
tile.tile.style.borderLeftColor = state.highlight && isOff ? OFF : "transparent";

const spark = sparklines[i];
const byMonth = MONTHS.map((_, m) => totals((r) => inRegion(r) && r.month === m));
spark.actual.clear();
spark.actual.appendRange(MONTHS.map((_, m) => m), byMonth.map((s) => kpi.of(s.actual)));
spark.comparison.clear();
spark.comparison.appendRange(MONTHS.map((_, m) => m), byMonth.map((s) => kpi.of(s[state.compare])));
Object.assign(spark.periodBox, periodRange);
});

// Revenue trend
const byMonth = MONTHS.map((_, m) => totals((r) => inRegion(r) && r.month === m));
for (const kind of ["actual", "target", "lastYear"]) monthly[kind] = byMonth.map((s) => s[kind].revenue);
const x = MONTHS.map((_, m) => m);
revenueSeries.clear();
revenueSeries.appendRange(x, monthly.actual);
targetSeries.clear();
targetSeries.appendRange(x, monthly.target);
lastYearSeries.clear();
lastYearSeries.appendRange(x, monthly.lastYear);
Object.assign(trendPeriodBox, periodRange);
const regionName = state.region === "all" ? "all regions" : REGIONS[Number(state.region)];
trend.sciChartSurface.title = `Monthly revenue, ${regionName} (shaded: selected period)`;

// Bullet chart
bulletRows = REGIONS.map((name, region) => {
const s = totals((r) => r.region === region && inPeriod(r));
return { name, actual: s.actual.revenue, comparison: s[state.compare].revenue, ratio: s.actual.revenue / s[state.compare].revenue };
});
const scaleEnd = 1.3 * Math.max(...bulletRows.map((row) => Math.max(row.actual, row.comparison)));
bulletScale.visibleRange = new NumberRange(0, scaleEnd);
setPoorBand(() => 0, (row) => 0.9 * row.comparison);
setFairBand((row) => 0.9 * row.comparison, (row) => row.comparison);
setGoodBand((row) => row.comparison, () => scaleEnd);
setActualBar(() => 0, (row) => row.actual);
const markerHalfWidth = scaleEnd / 300;
setMarker((row) => row.comparison - markerHalfWidth, (row) => row.comparison + markerHalfWidth);
bulletLabels.forEach((label) => bullet.sciChartSurface.annotations.remove(label, true));
bulletLabels = bulletRows.map((row, i) =>
new TextAnnotation({
x1: i,
y1: 0.985 * scaleEnd,
text: `${Math.round(100 * row.ratio)}%`,
fontSize: 14,
textColor: "#0B1A33",
horizontalAnchorPoint: EHorizontalAnchorPoint.Right,
verticalAnchorPoint: EVerticalAnchorPoint.Center
})
);
bullet.sciChartSurface.annotations.add(...bulletLabels);
bullet.sciChartSurface.title = `Revenue by region vs ${compareName().toLowerCase()} (marker), this period`;

// Waterfall of the variance: one step per region, or per product line when one region is selected
const byRegion = state.region === "all";
const parts = byRegion ? REGIONS : PRODUCTS;
let running = 0;
bridgeBars = parts.map((label, i) => {
const s = totals((r) => inRegion(r) && inPeriod(r) && (byRegion ? r.region === i : r.product === i));
const change = s.actual.revenue - s[state.compare].revenue;
const bar = { label, change, from: running, to: running + change };
running += change;
return bar;
});
bridgeBars.push({ label: "Total", change: running, from: 0, to: running, isTotal: true });
bridgeSeries.clear();
bridgeSeries.appendRange(
bridgeBars.map((_, i) => i),
bridgeBars.map((bar) => Math.min(bar.from, bar.to)),
bridgeBars.map((_, i) => i),
bridgeBars.map((bar) => Math.max(bar.from, bar.to))
);
bridgeAxis.visibleRange = new NumberRange(-0.6, bridgeBars.length - 0.4);
bridgeAxis.labelProvider.invalidateCache(); // the labels change between regions and product lines
bridgeLabels.forEach((label) => bridge.sciChartSurface.annotations.remove(label, true));
bridgeLabels = bridgeBars.map((bar, i) =>
new TextAnnotation({
x1: i,
y1: bar.change >= 0 ? Math.max(bar.from, bar.to) : Math.min(bar.from, bar.to),
text: signedMoney(bar.change),
fontSize: 14,
textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Center,
verticalAnchorPoint: bar.change >= 0 ? EVerticalAnchorPoint.Bottom : EVerticalAnchorPoint.Top
})
);
bridge.sciChartSurface.annotations.add(...bridgeLabels);
bridge.sciChartSurface.title = `Revenue gap vs ${compareName().toLowerCase()}, by ${byRegion ? "region" : "product line"}`;

// Palette providers are read when the chart draws, so ask the charts to redraw
[tileChart, trend, bullet, bridge].forEach((chart) => chart.sciChartSurface.invalidateElement());
}

// ---- Controls ----
for (const name of ["period", "compare", "region"]) {
ui[name].addEventListener("change", () => {
state[name] = ui[name].value;
update();
});
}
ui.highlight.addEventListener("change", () => {
state.highlight = ui.highlight.checked;
update();
});
update();

Key points:

  • The four tiles are HTML text laid over one SciChartSurface with four SciChartSubSurfaces, one per tile. Each sub-chart draws its tile's background and a sparkline with hidden axes.
  • The trend is a FastColumnRenderableSeries with two FastLineRenderableSeries for target and last year. A palette provider colours each month's column from its index, so changing the comparison or the highlight only needs a redraw.
  • The bullet chart and the waterfall are both FastRectangleRenderableSeries over an XyxyDataSeries, where each rectangle has explicit start and end values: the bands, bar and target marker for a bullet, and the floating steps for the waterfall.
  • Every filter change recomputes the totals in plain JavaScript and replaces each series' data with clear() and appendRange(), so the charts are created once and only their data changes.

See it in the demo app: JavaScript multi-chart dashboard · React multi-chart dashboard · Angular multi-chart dashboard. For gauges, see the React linear gauges and the React polar gauge dashboard; for target lines, the React chart with a draggable threshold; for a full monitoring screen, the React server traffic dashboard.

Go deeper: SciChart.js column series documentation, the line series documentation, the rectangle series documentation, palette providers for colouring values by rule, and sub-charts, including a large dashboard built with sub-charts.

Frequently asked questions​

What should be on a KPI dashboard?​

A KPI dashboard should show the few measures that tell you whether a goal is being met, each with its current value, the period it covers, a comparison with a target or an earlier period, and a short trend. Below those headline numbers, add a trend chart and a breakdown that explains what is driving them. Leave out anything nobody would act on.

How many KPIs should a dashboard have?​

As few as answer the dashboard's question, and no more than fit on one screen without scrolling. In practice that usually means a handful of headline KPIs, often four to eight, with supporting charts beneath them. If a dashboard needs twenty headline numbers, it is usually trying to serve several audiences and should be split.

What is the difference between a KPI and a metric?​

A metric is any number you measure, such as page views, calls made or units shipped. A KPI (key performance indicator) is one of the few metrics chosen because it shows progress towards a specific goal, has a target and an owner, and leads to action when it moves. Every KPI is a metric, but most metrics are not KPIs.

What is the difference between a KPI dashboard and a KPI report?​

A KPI dashboard is a screen that is kept up to date and read at a glance, usually interactive, so people can filter and drill down. A KPI report is a fixed snapshot for one period, often a document or slide pack, with more commentary explaining the numbers. Many teams use the dashboard day to day and a report for monthly or quarterly reviews.

What is a sales dashboard?​

A sales dashboard is a KPI dashboard for a sales team. It typically shows revenue or bookings against quota, the pipeline by stage, win rate, average deal size and sales cycle length, broken down by region, product or salesperson. Sales leaders use it to forecast the period and see where to coach or add effort.

How do I make a KPI dashboard in JavaScript?​

Compute each KPI and its comparison from your data in plain JavaScript, then lay out HTML tiles for the headline numbers and a grid of charts underneath. With SciChart.js, draw the tile sparklines as sub-charts of one surface, the trend as a column series with target lines, the bullet chart and waterfall with rectangle series, and use palette providers to colour off-target values. Re-run the calculation when a filter changes.

Sources​

  • Kaplan, R. S. and Norton, D. P. (1992), The Balanced Scorecard: Measures That Drive Performance, Harvard Business Review, 70(1). The four perspectives and balancing results with the measures that drive them.
  • Doran, G. T. (1981), "There's a S.M.A.R.T. way to write management's goals and objectives", Management Review, 70(11), pp. 35–36.
  • Few, S. (2013), Information Dashboard Design: Displaying Data for At-a-Glance Monitoring, 2nd edition, Analytics Press. Strategic, analytical and operational dashboards. And Few, S. (2013), Bullet Graph Design Specification, Perceptual Edge.
  • Parmenter, D. (2019), Key Performance Indicators: Developing, Implementing, and Using Winning KPIs, 4th edition, Wiley. KPIs compared with other performance and result measures.
  • Pernice, K. (2017), F-Shaped Pattern of Reading on the Web: Misunderstood, But Still Relevant (Even on Mobile), Nielsen Norman Group.
  • Colour Blind Awareness, Colour blindness (about 1 in 12 men and 1 in 200 women), and W3C, Understanding WCAG 2.2 Success Criterion 1.4.1: Use of Color.
  • ISO 22400-2:2014, Automation systems and integration: Key performance indicators (KPIs) for manufacturing operations management, Part 2: Definitions and descriptions. Includes overall equipment effectiveness.
  • Strathern, M. (1997), "Improving ratings: audit in the British University system", European Review, 5(3), pp. 305–321. The common wording of Goodhart's law.