Skip to content

Function: addRegression() ​

ts
function addRegression(plot, opts): RegressionHandle;

Defined in: stats/charts.ts:50

A trend line over a scatter — least squares by default, with an optional confidence band, or a LOESS curve when the relationship is not linear. The series name carries r² so the chart states its own fit quality.

Parameters ​

ParameterType
plotPlot
optsRegressionOptions

Returns ​

RegressionHandle

MIT licensed. WebGL2 required.