RuleLineForLabelChart
overlays vertical or horizontal reference lines based on label (or date) positions in a chart. It is commonly used to highlight specific categories or time points in combination with other chart types, such as BarChart
or LineChart
.
Property | Type | Description |
---|---|---|
labelOnYAxis |
boolean |
If true , rule lines are drawn horizontally using Y-axis label positions. Default is vertical. |
marks |
Array |
An array of labeled rule definitions. Each mark can include styling options from ChartMarkProps . |
Each item in marks
can include:
label
: The string or date at which to draw the rule.unit
: Optional, only relevant for date-based axes.foregroundStyle
: Optional. Controls the color.opacity
: Optional. Controls line transparency.lineStyle
: Optional. Allows custom dashing (e.g., [3, 2]
).