Basic Syntax
Use a code fence with thechart kind and type parameter:
```chart:name type=chart-type
name: Unique identifier for the charttype: Chart type (default:bar)
Chart Types
Handhold supports 7 chart types:Bar Chart (type=bar)
Vertical bars for categorical comparisons.
- Comparing categories
- Showing discrete values
- Quarterly/monthly data
Line Chart (type=line)
Connected points showing trends over time.
- Time series data
- Showing trends
- Continuous change
Area Chart (type=area)
Filled area under a line, emphasizing magnitude.
- Cumulative values
- Emphasizing volume
- Stacking multiple series
Scatter Plot (type=scatter)
Points showing correlation between variables.
- Correlation analysis
- Distribution patterns
- Outlier detection
Pie Chart (type=pie)
Circular chart showing proportions (uses first series only).
- Part-to-whole relationships
- Percentages
- Market share
Radar Chart (type=radar)
Multi-axis chart showing multiple metrics.
- Comparing multiple dimensions
- Performance metrics
- Balanced scorecards
Radial Bar Chart (type=radial)
Circular bars extending from center.
- Progress indicators
- Completion percentages
- Cyclical data
Data Formats
Simple Format (Single Series)
Key-value pairs, one per line:- Creates one series named “default”
- Labels are the keys
- Values are numbers (can be negative or decimal)
Table Format (Multiple Series)
Markdown table with first column as labels:- First column = x-axis labels
- Remaining columns = series (one per column)
- Header row defines series names
- Separator row (
|---|---|) is optional
Annotations
Add vertical reference lines with labels:annotate: label "text"
label: Matches an x-axis labeltext: Annotation text (quoted)- Renders as vertical dashed line with label
Shaded Regions
Highlight ranges on the x-axis:shade: from..to color
fromandto: x-axis labelscolor: Hex color code (e.g.,#e0f2fe)- Renders as translucent background fill
Regions
Regions target x-axis labels for focus:{{focus: region}} to highlight specific data points.
Real Example
Multi-Series Example
Best Practices
Chart Type Selection
Use bar charts for:- Categorical comparisons
- Discrete time periods (quarters, years)
- Small number of categories (< 10)
- Continuous time series
- Showing trends
- Multiple series comparisons
- Cumulative totals
- Stacked data
- Emphasizing magnitude
- Part-to-whole (< 6 categories)
- Percentages adding to 100%
- Simple proportions
Data Quality
- Keep labels short (1-3 words)
- Use consistent time intervals
- Limit series count (3-4 max for readability)
- Round values to significant digits
Annotations
- Use sparingly (1-2 per chart)
- Explain anomalies, not obvious data
- Keep text brief (2-5 words)
Colors
Shaded regions support any hex color:- Success/positive:
#dcfce7(light green) - Warning/caution:
#fef3c7(light yellow) - Error/negative:
#fee2e2(light red) - Info/neutral:
#e0f2fe(light blue)