A bullet chart displays a single quantitative measure (the actual value) against qualitative range bands (e.g. poor / satisfactory / good) and an optional target marker. It was designed by Stephen Few as a compact, information-dense alternative to gauge charts.
bullet_chart(
value,
ranges,
target = NULL,
rangeColors = NULL,
title = "",
subtitle = "",
min = 0,
valueColor = "#1a1a2e",
targetColor = "#e63946",
tickCount = 5,
fontSize = 12,
font = "Verdana, Geneva, Tahoma, sans-serif",
bgcol = "white",
width = NULL,
height = NULL
)Numeric. The actual value to display (the main bar).
Numeric vector of upper bounds for each qualitative band,
in ascending order (e.g. c(40, 70, 100)). The lower bound of the
first band is min.
Optional numeric. The target / goal value shown as a short
vertical marker. Defaults to NULL (no marker drawn).
Character vector of colors for each band, in the same
order as ranges. Defaults to a sequence of grays from darker (low
range) to lighter (high range).
Character. Label displayed to the left of the chart.
Defaults to "".
Character. Smaller label displayed below title.
Defaults to "".
Numeric. The minimum value of the scale. Defaults to 0.
The color of the actual-value bar. Defaults to
"#1a1a2e".
The color of the target marker. Defaults to
"#e63946".
Number of axis ticks. Defaults to 5.
Base font size in pixels. Defaults to 12.
The font family used for all text. Defaults to
"Verdana, Geneva, Tahoma, sans-serif".
The background color of the SVG. Defaults to "white".
Optional. The width of the SVG output.
Optional. The height of the SVG output.
An SVG bullet chart.
# Sales revenue vs target
bullet_chart(
value = 270,
target = 300,
ranges = c(150, 225, 350),
title = "Revenue",
subtitle = "USD thousands"
)
# Customer satisfaction score
bullet_chart(
value = 7.4,
target = 8.0,
ranges = c(4, 7, 10),
title = "Satisfaction",
subtitle = "out of 10",
valueColor = "steelblue"
)
# Server response time (lower is better — ranges go poor → good left to right)
bullet_chart(
value = 320,
target = 250,
ranges = c(200, 500, 1000),
rangeColors = c("#f5f5f5", "#e0e0e0", "#c0c0c0"),
title = "Response",
subtitle = "ms",
min = 0
)