Skip to content

Parts, stages, and flows

These examples use the chart exports on main. See the Charts overview for platform setup and release compatibility.

Both charts read one value per category as its share of the positive total. Donut uses the same input with a central hole. Zero, negative, and missing values remain in the data table but do not produce a slice.

Web preview
ChannelVisits
Search430 (45.7%)
Direct320 (34%)
Referral190 (20.2%)
ChannelVisits
Search430 (45.7%)
Direct320 (34%)
Referral190 (20.2%)
TrafficPie.tsx
import { DonutChart, PieChart } from '@hozo/charts'const channels = [  { channel: 'Search', visits: 430 },  { channel: 'Direct', visits: 320 },  { channel: 'Referral', visits: 190 },]const props = {  data: channels,  x: { key: 'channel', label: 'Channel' },  value: { key: 'visits', label: 'Visits' },  height: 240,}export function TrafficPie() {  return <PieChart {...props} accessibilityLabel="Traffic share by channel (pie)" />}export function TrafficDonut() {  return <DonutChart {...props} accessibilityLabel="Traffic share by channel (donut)" />}

The row order is the stage order. The chart reports each stage’s value and how much of the previous stage it retained. Zero and missing values are not drawn, but the table still lists those stages.

Web preview
StagePeopleKept from the stage before
Visited1000No value
Started30030%
Completed12040%
SignupFunnel.tsx
import { FunnelChart } from '@hozo/charts'export function SignupFunnel() {  return (    <FunnelChart      accessibilityLabel="Visitors progressing through sign-up"      data={[        { stage: 'Visited', people: 1000 },        { stage: 'Started', people: 300 },        { stage: 'Completed', people: 120 },      ]}      x={{ key: 'stage', label: 'Stage' }}      value={{ key: 'people', label: 'People' }}      height={240}    />  )}

Use a treemap for parts within groups. The children field holds nested rows, and a group gets its value from its descendants. On Web, Enter goes into the active group and Escape goes back out. Native exposes equivalent activate and escape accessibility actions.

Web preview
TeamGroupBudgetShare of its group
HardwareAll$73078.5%
PhonesHardware$42057.5%
LaptopsHardware$31042.5%
DesignAll$20021.5%
TeamBudget.tsx
import { TreemapChart } from '@hozo/charts'export function TeamBudget() {  return (    <TreemapChart      accessibilityLabel="Budget by team"      data={[        {          team: 'Hardware',          children: [            { team: 'Phones', budget: 420 },            { team: 'Laptops', budget: 310 },          ],        },        { team: 'Design', budget: 200 },      ]}      x={{ key: 'team', label: 'Team' }}      value={{ key: 'budget', label: 'Budget', format: (value) => `$${value}` }}      height={260}    />  )}

Each row is a flow from source to target. The width shows its value. Keep the flow directed forward: edges that go back to an earlier or the same column are listed in the table and summary but not drawn.

Web preview
FromToPeopleShare of its source
VisitSignup42042%
VisitLeft58058%
SignupPaid14033.3%
SignupLeft28066.7%
VisitorFlows.tsx
import { SankeyChart } from '@hozo/charts'export function VisitorFlows() {  return (    <SankeyChart      accessibilityLabel="Where visitors went"      data={[        { source: 'Visit', target: 'Signup', people: 420 },        { source: 'Visit', target: 'Left', people: 580 },        { source: 'Signup', target: 'Paid', people: 140 },        { source: 'Signup', target: 'Left', people: 280 },      ]}      value={{ key: 'people', label: 'People' }}      height={260}    />  )}

Radar compares profiles across the same dimensions, one spoke per row. Radial bars are separate rings; the length of each bar describes a value, not a share of the other rows. Here both examples use a fixed 0–100 domain.

Web preview
CategoryActualTarget
Availability95%99%
Coverage72%85%
Accessibility88%95%
CategoryAchieved
Availability95%
Coverage72%
Accessibility88%
GoalProfiles.tsx
import { RadarChart, RadialBarChart } from '@hozo/charts'const goals = [  { goal: 'Availability', actual: 95, target: 99 },  { goal: 'Coverage', actual: 72, target: 85 },  { goal: 'Accessibility', actual: 88, target: 95 },]const axis = { domain: [0, 100] as const, format: (value: number) => `${value}%` }export function GoalProfiles() {  return (    <RadarChart      accessibilityLabel="Actual and target by goal"      data={goals}      x={{ key: 'goal' }}      y={axis}      series={[        { key: 'actual', label: 'Actual' },        { key: 'target', label: 'Target' },      ]}      points      height={280}    />  )}export function GoalProgress() {  return (    <RadialBarChart      accessibilityLabel="Percentage achieved by goal"      data={goals}      x={{ key: 'goal' }}      y={axis}      series={[{ key: 'actual', label: 'Achieved' }]}      height={280}    />  )}