Skip to content
InsightCharts

Search

Search guides and components

Pictogram chart

Compares quantities with rows of repeated icons, each icon standing for a fixed number of units.

Use when
A few categories (2 to 6) of countable things, people, homes, vehicles, where making the quantity concrete matters more than reading precise values.
Avoid when
More than about 8 categories or values that need precise comparison (use bar chart); a share of one whole (use waffle chart); values that would need more than about 60 icons in a row (raise unit, or use bar chart).

Preview

Delhi had 33.8 million people in 2024, 3.3 million fewer than Tokyo

Population of the five largest urban agglomerations, 2024

Source: UN World Urbanization Prospects · Figures are approximate, for illustration

Composition

Used in

1 molecule uses pictogram chart.

Molecules

1

The sheet an infographic is composed on. It paints a full-bleed ground from a poster theme, forces one theme and colour mode on everything inside, and lays out a masthead, a grid of panels and a footer. It can save the whole sheet as one PNG.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/pictogram-chart

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { PictogramChart } from "insightcharts";

Examples

Houses, sorted

The UK completed 3.1 million homes in the 1970s and 1.5 million in the 2010s

New dwellings completed per decade, United Kingdom

Source: ONS house building data · Rounded for illustration

Shares as drops

Agriculture accounts for 70% of global freshwater withdrawals

Share of global freshwater withdrawals by sector

Source: FAO AQUASTAT · Figures are approximate, for illustration

Stress: many icons wrap, long names

There were 28.4 million battery electric cars on the road in 2023

Electric cars on the road worldwide, 2023

Source: IEA Global EV Outlook 2024 · Figures are approximate, for illustration

Props

PropTypeDefaultDescription
namerequiredstringCategory field: one row of icons per category.
valuerequiredstringValue field.
unitnumberUnits per icon. Default: a round number giving the largest row about ten icons.
unitLabelstringWhat one icon stands for, for the key line, e.g. "1 million people".
iconIconName | "path://...""person"Built-in icon name from core/icons.ts ("person", "house", "car", "tree", "coin", "drop", "bolt", "wind-turbine", "wheat" and about 60 more) or a custom single SVG path.
iconsRecord<string, string>Icon per category key; falls back to icon.
perRownumberWrap rows after this many icons. Default: as many as fit.
labelsbooleantruePrint the value after each row.
sort"none" | "asc" | "desc""none"Row order.
Common chart props 29

Every chart built with defineChart accepts these on top of its own props.

PropTypeDescription
dataDataInputRows, CSV text, a URL, { url, path }, an async function, or an Arrow-style table. Omit inside <InsightData>.
transformTransform | Transform[]A pipeline of transforms applied before drawing.
titlestringThe title. One plain statement of what the data shows, with the number and the period ("Monthly churn fell from 4.2% to 2.1% in 2024"), or a plain label ("Monthly churn, 2024"). One clause, no figures of speech.
subtitlestringMeasure, unit, population, period.
sourcestringData source, shown as "Source: ...".
notestringMethod notes or caveats.
heightnumber | stringCSS height of the plot. Default 360.
aspectnumberWidth / height. Overrides height.
highlightstring | string[]The entity (or entities) the title is about. Every other series is drawn in grey.
annotationsAnnotation[]Reference lines, shaded bands and callouts, in data coordinates.
formatFormatSpecHow to print values: "compact", "percent", "currency:USD", "{value} kg", Intl options, or a function.
legendbooleanShow the legend. Default: shown when there are two or more series.
selectboolean | stringMake marks clickable to filter. Inside <InsightData> the selection filters every other chart. Pass a field name, or true to use the chart's category field.
onSelect(values: string[], field: string) => voidCalled with the selected values whenever the selection changes.
optionEChartsOption | ((option: EChartsOption, ctx: BuildContext) => EChartsOption)Deep-merged over the generated ECharts option, or a function that receives and returns it. Use it for ECharts settings no prop covers.
themeThemeInputA theme, or a partial set of tokens merged over the surrounding theme, for this chart only.
modeModeInput"auto" (default) follows the page, "system" follows the OS, or force "light" / "dark".
rendererRendererInput"auto" (default) uses SVG for light charts and canvas for heavy ones.
animatebooleanSet false to disable animation. Reduced-motion preferences are always respected.
lazybooleanMount the chart only when it scrolls near the viewport. Default true.
groupstringLink tooltips with other charts sharing this group id.
exportableboolean | ExportFormat[]Show an export menu: true or a list of formats from png, jpeg, svg, pdf, csv, json.
tablebooleanShow a collapsible "View data" table under the chart.
altstringAccessible description: the chart type and measures, then the main pattern and the notable values.
idstringStable id for this chart's selection in the shared store.
onEventsRecord<string, ChartEventHandler>ECharts event handlers, e.g. { click: (params, chart) => {} }. Prefix a name with zr: to bind to the canvas itself.
onReady(chart: EChartsInstance) => voidCalled with the ECharts instance once it is created.
classNamestringClass name for the outer <figure>.
styleCSSPropertiesInline style for the outer <figure>.