Skip to content
Calm motion: animations on this site only fade, with no movement

Lollipop ​

A thin stick with a dot for each category

Compares the values of many categories, as a bar chart does, with less ink. Thin sticks keep a long list easy to read. For bars with series side by side, use the bar chart.

Basic
Average minutes listened, by episode
ItemValue
Ep. 4142 min
Ep. 3638 min
Ep. 4036 min
Ep. 3435 min
Ep. 3933 min
Ep. 3231 min
Ep. 3730 min
Ep. 3328 min
Ep. 3826 min
Ep. 3522 min
  • data is a list of items. Each item has a label, a value, and an optional color that makes it stand out.
  • Each stick starts at zero and ends with a dot at the value, and the value shows after the dot. A value below zero goes to the left.
  • sort puts the items in order of value, high first. Without it, the items keep the order of the list.
  • color sets the color of the sticks (default chart-1), and format sets the text of a value.
  • For screen readers, the chart is a table. label names the table. Change the column names with labels or a label pack: item and value.

Usage ​

ts
import { BlessLollipop } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
data*BlessLollipopItem[]—
sortboolean—put the items in order of value, high first
colorstring"chart-1"
format((v: number) => string)—
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ item: string; value: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.