Rule
Reference lines for thresholds, targets, and averages.
Rules draw a single line across the full width (ruleY) or full height (ruleX) of the plot. Use them for targets, thresholds, baselines, or averages.
ruleY
A horizontal line at a y value:
ruleX
A vertical line at an x value:
Multiple rules
Add several rules for bands or zones. Rules draw on top of earlier marks:
How rules work
Rules use their own data with a single datum containing the threshold value:
{
"type": "ruleY",
"data": [{ "y": 30 }],
"stroke": "#c0392b",
"strokeWidth": 2
}Properties
| Field | Type | Default | Description |
|---|---|---|---|
stroke | string | – | Stroke color: field name or #hex literal. |
strokeWidth | number | 1 | Line width in pixels. |