Trend / regression line
native
Fitted line over scatter data
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.annotations.
Regression overlay on scatter or a cartesian series: linear or loess, with an optional confidence band. Not a separate chart type.
Source: chartkit:packages/core/src/annotations.ts:19
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "scatter",
"data": [
{
"x": 16,
"y": 3
},
{
"x": 22,
"y": 5
}
],
"encoding": {
"x": "x",
"y": "y"
},
"a11y": {
"alt": "Y peaks at 22."
},
"size": {
"width": 640,
"height": 260
},
"annotations": [
{
"type": "regression",
"method": "linear",
"band": true,
"label": "Fit"
}
]
}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: type.regression.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | — | npm · weak | — |
| Recharts | partial | Scatter.lineType=fittinglinear fit only, scatter series | types · strong | recharts/types/cartesian/Scatter.d.ts:126 |
| Apache ECharts | plugin | — | npm · weak | — |
| Highcharts | native | series.type=linearregressionstock indicators module; or trendline | types · strong | highcharts/options/abands.d.ts:1386 |
| Plotly.js | none | — | absence · absence | — |
| Nivo | none | — | absence · absence | — |
| Victory | none | — | absence · absence | — |
| visx | none | — | absence · absence | — |
| ApexCharts | none | — | absence · absence | — |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | native | linearRegressionY, linearRegressionX | types · strong | @observablehq/plot/src/marks/linearRegression.d.ts:111 |
| Vega-Lite | native | grep: regressionregression transform | grep · weak | 21349: "RegressionTransform" |
| AG Charts | native | grep: trendLine | grep · weak | ag-charts-enterprise/dist/types/src/features/annotations/scenes/fibonacciScene.d.ts:10 |
| amCharts 5 | native | RegressionSeries | types · strong | @amcharts/amcharts5/.internal/charts/stock/drawing/RegressionSeries.d.ts:8 |
| Google Charts | native | grep: trendlines | grep · weak | @types/google.visualization/index.d.ts:614 |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | none | — | absence · absence | — |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | manual | grep: register | mechanism · weak | @antv/g2/lib/exports.d.ts:2 |