Horizontal reference line
native
Line at a y value (target, threshold)
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.annotations.
{type:'rule', axis:'y', value}
Source: chartkit:packages/core/src/generated/schema.ts:69
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "line",
"data": [
{
"quarter": "Q1",
"units": 40
},
{
"quarter": "Q2",
"units": 55
}
],
"encoding": {
"x": "quarter",
"y": "units"
},
"a11y": {
"alt": "Units rose in Q2."
},
"size": {
"width": 640,
"height": 260
},
"annotations": [
{
"type": "rule",
"axis": "y",
"value": 50,
"label": "Mark"
}
]
}Other libraries
Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: annotation.line.y.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | — | npm · weak | — |
| Recharts | native | ReferenceLine | types · strong | recharts/types/cartesian/ReferenceLine.d.ts:156 |
| Apache ECharts | native | series.markLine | types · strong | echarts/types/dist/shared.d.ts:12499 |
| Highcharts | native | yAxis.plotLines | types · strong | highcharts/highcharts.d.ts:110516 |
| Plotly.js | native | layout.shapes | types · strong | plot-schema.json#layout.layoutAttributes.shapes |
| Nivo | native | Line.markersmarkers axis:'y' | types · strong | @nivo/line/dist/types/types.d.ts:186 |
| Victory | manual | VictoryBarProps.dataComponentVictoryLine with constant data | mechanism · weak | victory-core/lib/victory-util/common-props.d.ts:9 |
| visx | manual | GroupLine + scale | mechanism · weak | @visx/group/lib/Group.d.ts:15 |
| ApexCharts | native | annotations.yaxis | types · strong | apexcharts/types/apexcharts.d.ts:2658 |
| Tremor (npm) | none | —no reference lines | absence · absence | — |
| Observable Plot | native | ruleY | types · strong | @observablehq/plot/src/marks/rule.d.ts:137 |
| Vega-Lite | native | mark=rule | types · strong | vega-lite/build/spec/unit.d.ts:19 |
| AG Charts | native | grep: crossLinesaxes[].crossLines type 'line' | grep · weak | ag-charts-enterprise/dist/types/src/main.d.ts:9 |
| amCharts 5 | native | grep: createAxisRange | grep · weak | @amcharts/amcharts5/radar.d.ts:5 |
| Google Charts | none | —use an extra series | absence · absence | — |
| uPlot | manual | Options.hookshooks draw | mechanism · weak | uplot/dist/uPlot.d.ts:394 |
| TradingView Lightweight Charts | native | grep: createPriceLine | grep · weak | 2531: * const priceLine = series.createPriceLine({ |
| MUI X Charts | native | ChartsReferenceLine | types · strong | @mui/x-charts/ChartsReferenceLine/ChartsReferenceLine.d.mts:5 |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | native | MarkTypes=lineY | types · strong | @antv/g2/lib/spec/mark.d.ts:13 |