The RuleLineForValueChart
component is used to draw one or more horizontal or vertical reference lines on a chart, based on numeric values. This is useful for highlighting thresholds, targets, or reference levels in your data visualization.
This example renders two rule lines:
50
75
, with a dash pattern of 2-point dash and 4-point gaplabelOnYAxis
(optional)boolean
false
true
, the chart displays value labels on the Y Axis, and rule lines are rendered vertically.
When false
, labels appear on the X Axis and lines are horizontal.marks
(required)Type:
Description:
Each item in the marks
array defines a rule line at a specific value
.
value
ChartMarkProps
(optional extensions)You can also customize each line using standard chart mark properties:
foregroundStyle
: Set color or gradientopacity
: Set line transparencylineStyle
: Customize the stroke pattern (e.g., dashed lines)RuleLineForValueChart
is a minimal yet powerful overlay chart component that enables enhanced readability and interpretation by visually marking important numerical values on your chart. It can be used alongside other chart types such as BarChart
, LineChart
, or PointChart
to enrich data visualization.