szum

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

FieldTypeDefaultDescription
strokestringStroke color: field name or #hex literal.
strokeWidthnumber1Line width in pixels.

On this page