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
| Item | Value |
|---|---|
| Ep. 41 | 42 min |
| Ep. 36 | 38 min |
| Ep. 40 | 36 min |
| Ep. 34 | 35 min |
| Ep. 39 | 33 min |
| Ep. 32 | 31 min |
| Ep. 37 | 30 min |
| Ep. 33 | 28 min |
| Ep. 38 | 26 min |
| Ep. 35 | 22 min |
datais a list of items. Each item has alabel, avalue, and an optionalcolorthat 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.
sortputs the items in order of value, high first. Without it, the items keep the order of the list.colorsets the color of the sticks (defaultchart-1), andformatsets the text of a value.- For screen readers, the chart is a table.
labelnames the table. Change the column names withlabelsor a label pack:itemandvalue.
Usage
ts
import { BlessLollipop } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
data* | BlessLollipopItem[] | — | |
sort | boolean | — | put the items in order of value, high first |
color | string | "chart-1" | |
format | ((v: number) => string) | — | |
label | string | "Chart" | names the chart and its table for screen readers |
labels | Partial<{ item: string; value: string; }> | — |