Cookbook
Copy-paste chart patterns for common use cases.
Real-world patterns you can use as starting points. Every example is editable – expand the code, tweak it, and see the chart update.
KPI bar chart with labels
Quarterly deal value with labels on top. Two marks sharing top-level data:
Week-over-week comparison
Two line series with dots, comparing periods:
Sparkline
Minimal chart with no title, no axes, tight margins – perfect for embedding in dashboards, emails, or table cells:
Stacked area chart
Traffic sources over time, stacked to show totals:
Conversion funnel
Horizontal bars ordered by stage – shows drop-off at each step:
Custom color assignment
Explicit colors for specific series – useful when colors carry meaning:
Monitoring with threshold
Line + dot with a rule showing the SLA boundary:
A/B comparison (dodged bars)
Side-by-side bars for comparing two groups:
Time series
UTC dates on the x-axis with automatic formatting:
Stacked bars with legend
Multiple categories stacked to show composition: