Features · type

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.

Y peaks at 22.Y peaks at 22.x 16, y 3x 22, y 5Fit34516182022
{
  "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.

LibraryStatusOptionVerificationSource
Chart.jsplugin—npm · weak—
RechartspartialScatter.lineType=fittinglinear fit only, scatter seriestypes · strongrecharts/types/cartesian/Scatter.d.ts:126
Apache EChartsplugin—npm · weak—
Highchartsnativeseries.type=linearregressionstock indicators module; or trendlinetypes · stronghighcharts/options/abands.d.ts:1386
Plotly.jsnone—absence · absence—
Nivonone—absence · absence—
Victorynone—absence · absence—
visxnone—absence · absence—
ApexChartsnone—absence · absence—
Tremor (npm)none—absence · absence—
Observable PlotnativelinearRegressionY, linearRegressionXtypes · strong@observablehq/plot/src/marks/linearRegression.d.ts:111
Vega-Litenativegrep: regressionregression transformgrep · weak21349: "RegressionTransform"
AG Chartsnativegrep: trendLinegrep · weakag-charts-enterprise/dist/types/src/features/annotations/scenes/fibonacciScene.d.ts:10
amCharts 5nativeRegressionSeriestypes · strong@amcharts/amcharts5/.internal/charts/stock/drawing/RegressionSeries.d.ts:8
Google Chartsnativegrep: trendlinesgrep · weak@types/google.visualization/index.d.ts:614
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsnone—absence · absence—
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2manualgrep: registermechanism · weak@antv/g2/lib/exports.d.ts:2