Recipes Short answers to the things people change first.
Format values tsx Copy Monthly revenue Monthly revenue Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. 0 8.4K 16.8K 25.2K 33.6K Jan Feb Mar Apr May Jan: $21.4k Feb: $24.8k Mar: $23.9k Apr: $29.1k May: $33.6k Click a mark to pin its value
View data Monthly revenue Label Value Jan $21.4k Feb $24.8k Mar $23.9k Apr $29.1k May $33.6k
formatValue applies to axis labels, on-chart values, pinned captions and the data table.
Custom colors tsx Copy Traffic sources Traffic sources Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. Organic: 46 Direct: 31 Referral: 23 100 Total Click a mark to pin its value
Organic 46 Direct 31 Referral 23
View data Traffic sources Label Value Organic 46 Direct 31 Referral 23
color sets the primary series. Pie, donut, funnel and treemap take colors, or a color on each datum.
Histograms tsx Copy Session duration (minutes) Session duration (minutes) Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. 0 2 4 6 8 9–16.17 16.17–23.33 23.33–30.5 30.5–37.67 37.67–44.83 44.83–52 9–16.17: 5 16.17–23.33: 7 23.33–30.5: 8 30.5–37.67: 5 37.67–44.83: 3 44.83–52: 3 Click a mark to pin its value
View data Session duration (minutes) Label Value 9–16.17 5 16.17–23.33 7 23.33–30.5 8 30.5–37.67 5 37.67–44.83 3 44.83–52 3
The largest sample lands in the final bin. Identical samples use a padded domain. The histogram helper returns the bins (lower, upper, label, value) if you want to draw your own.
Waterfall Values are signed changes to a running balance. Set total: true on a bar to treat it as an absolute balance measured from zero, such as an opening, subtotal or closing bar.
tsx Copy Revenue bridge Revenue bridge Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. 0 106 212 318 424 Opening Sales Refunds Upsell Churn Closing Opening: 240 (balance: 240) Sales: 160 (balance: 400) Refunds: -48 (balance: 352) Upsell: 72 (balance: 424) Churn: -35 (balance: 389) Closing: 389 (balance: 389) Click a mark to pin its value
View data Revenue bridge Label Value Balance Opening 240 240 Sales 160 400 Refunds -48 352 Upsell 72 424 Churn -35 389 Closing 389 389
negativeColor overrides the decline color. The data table and pinned caption include running balances. The waterfall helper returns steps with start and end balances.
Heatmap tsx Copy Activity Activity Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. Mon Tue Wed Thu Fri Morning Afternoon Evening Morning, Mon: 12 Morning, Tue: 28 Morning, Wed: 34 Morning, Thu: 19 Morning, Fri: 8 Afternoon, Mon: 22 Afternoon, Tue: 41 Afternoon, Wed: 47 Afternoon, Thu: 38 Afternoon, Fri: 25 Evening, Mon: 9 Evening, Tue: 14 Evening, Wed: 21 Evening, Thu: 17 Evening, Fri: 30 Click a mark to pin its value
Low 8 High 47
View data Activity Row / Column Value Morning, Mon 12 Morning, Tue 28 Morning, Wed 34 Morning, Thu 19 Morning, Fri 8 Afternoon, Mon 22 Afternoon, Tue 41 Afternoon, Wed 47 Afternoon, Thu 38 Afternoon, Fri 25 Evening, Mon 9 Evening, Tue 14 Evening, Wed 21 Evening, Thu 17 Evening, Fri 30
A missing pair renders blank, while an explicit 0 renders a low-intensity cell. Duplicate pairs and non-finite values are rejected.
Turn animation off tsx Copy Daily visits Daily visits Click a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below. 0 302.5 605 907.5 1.2K Mon Tue Wed Thu Fri Sat Sun Mon: 820 Tue: 934 Wed: 1,102 Thu: 987 Fri: 1,210 Sat: 640 Sun: 575 Click a mark to pin its value
View data Daily visits Label Value Mon 820 Tue 934 Wed 1,102 Thu 987 Fri 1,210 Sat 640 Sun 575
Reduced-motion preferences always win, even when animate is true.
Dark mode tsx Copy See Theming for toggling it from your own theme logic.