Linear and non-linear regression support for highcharts. Allows you to add regression series to any existing series on your chart. Calculates the r-squared value (coefficient of determination) and optionally prints it on the legend. If Linear or Polynomial regression is selected, you can print the equation on the legend.
For a basic usage just add this property to the series json
regression: true
And for advanced configuration you can add options to
regressionSettings: {}
Regression type: 'linear' ,'exponential', 'polynomial', 'power', 'logarithmic', 'loess'. Default: linear
Set the order (polynomial only). Default: 2
The name as it appears in the legend and tooltip. Use the following replacements:
%r
: Value of correlation coefficient%r2
: Value of coefficient of determination%eq
: Regression equation%se
: Standard error Default:Equation: %eq
Set the number of decimal places for r and r2 (linear only). Default: 2
??. Default: spline
The width of the regression line. Default: 2
Use one of Highcharts-recognized dash styles. Default: solid
Use one of Highcharts-recognized color definitions. Default: none.
??. Default: false
??. Default: 0
??. Default: 25
Whether to show the line itself. Hiding the line will grey out its legend item. Default: true
The opposite of visible
: show the line but not its legend item. Default: false
Stardard Highcharts tooltip object
The plugin exposes properties to series[regressionSeries].options.regressionOutputs (Object)
equation
(Array[Int]) individual parts of the regression equationpoints
(Array)rValue
(Int) correlation coefficientrSquared
(Int) coefficient of determinationstandardError
(Int)string
(String) the resulting formula in string format
- Basic default settings: linear regression with equation in the legend
- Polynomial regression - with extrapolation and different style
- Linear regression
- Loess regression 50% smooth
- Linear regression with coeficient of determination
- Download resgression data on different formats
- http://jsfiddle.net/3g4ryLc9/
- http://jsfiddle.net/3g4ryLc9/2/
- http://jsfiddle.net/3g4ryLc9/5/