Back to work

Selected work · 02 / Custom visuals

Charts we had to build.

Power BI ships with a fixed set of charts. Ours weren't in it, so I built some myself and guided the team on the rest: six custom visuals so far, a body-map heatmap, a bar visual, a gauge, a stacked-change column and KPI cards, all TypeScript. Rebuilt below, live.

My role: hands-on development for selected visuals; technical direction and team guidance for the others.

6custom visuals
12body regions
TypeScript + SVG0 chart librariesgauge · bars · stacks · cards

Demo data notice. Every value, date, injury count, percentage, trend and comparison here is fictional sample data, built only to demonstrate the visuals. None of it represents real people, incidents, organizations or business performance.

How it works

Power BI talks. Your code draws.

Built once. Then update() fires on every data, size or setting change. Run the loop

ONCE

constructor

Host builds the visual, hands over the DOM element. You set up your <svg>.

TRIGGER

data / size / setting changes

Someone filters, resizes, or tweaks a format control.

EVERY TIME

update(options)

The host calls your update() with fresh options.

READ

options.dataViews[0]

You pull out the reshaped data and current settings.

DRAW

render() → SVG

Clear the canvas, redraw at the new size.

idle
Data contract

bodyRegion grouping + injuryCount measure categorical dataView purpose-drawn SVG.

categories[] + values[]

Visual one · the injury body mapSample data

Injuries, mapped onto a body.

Two fields in: a body region and an injury count. Each region colours on a five-band scale; the panel groups them and flags the worst. Click a region to focus it

Date range
Total42 injuries

Injuries by Body Group

0
1–5
6–15
16–40
41+
Colour = number of injuries

Bands: 1–5 · 6–15 · 16–40 · 41+, all format-pane colours. This is the prototype. Its shipped twin bodyInjuryHeatmap swaps the bands for a smooth min→max gradient, tells left from right, and wires up Power BI selection, cross-highlight and tooltips.

Visual two · the bar visualSample data

A bar chart that does what the built-in one won't.

The details the built-in bar chart skips, each one a control in the format pane. Change the pane. The chart follows

Format · Bar visual
Total header
Show
Prefix
Alignment
Header border
Style
Thickness1.5
Radius6
Colour
Fonts & colour
Label size12
Value size13
Bars

Visual three · the semi-circle gaugeSample data

On target, at a glance.

One value, three states. Arc, number and status move together. Drag the value

81% On track

Actual value81%
min 0max 100
Below target0 – 59
At risk60 – 79
On track80 – 100

Min/max, zones and markers are all format-pane controls.Sample data

Iteration

One good version is really six.

Each release added one thing a report asked for. The old package was never overwritten, only superseded. Walk the versions

1.6.0Data

The Values role takes a measure or a grouping, so “Don't summarize” gives raw category values instead of a forced sum.