npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

highcharts-regression

v2.2.0

Published

This allows you to add regression lines to any series. Supports: linear, polynomial, logarithmic, exponential and loess. Calculates the r-value

Downloads

24,337

Readme

Highcharts Regression

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 settings:

type (String)

Regression type: 'linear' ,'exponential', 'polynomial', 'power', 'logarithmic', 'loess'. Default: linear

order (Int)

Set the order (polynomial only). Default: 2

name (String)

The name as it appears in the legend and tooltip. Use the following replacements:

decimalPlaces (Int)

Set the number of decimal places for r and r2 (linear only). Default: 2

lineType (String)

??. Default: spline

lineWidth (Int)

The width of the regression line. Default: 2

dashStyle (String)

Use one of Highcharts-recognized dash styles. Default: solid

color (String)

Use one of Highcharts-recognized color definitions. Default: none.

useAllSeries (Boolean)

??. Default: false

extrapolate (Int)

??. Default: 0

loessSmooth (Int)

??. Default: 25

visible (Boolean)

Whether to show the line itself. Hiding the line will grey out its legend item. Default: true

hideInLegend (Boolean)

The opposite of visible: show the line but not its legend item. Default: false

index (Int)

The index of the series in the chart, affecting the internal index in the chart.series array, the visible Z index as well as the order in the legend. Default: undefined

legendIndex (Int)

The sequential index of the series in the legend. Default: undefined

tooltip (Object)

Stardard Highcharts tooltip object

dataLabels (Array of objects)

Show dataLabels on specified points. Choose which points should have labels and enter their format. Supports Highchart dataLabel.format and the regression variables stated for name. Default: undefined

Format expected for dataLabel objects:

{
  pointIndex: number // Index of the point to add label to.
  format: string // The text/format for the label.
}
regressionSeriesOptions (Object)

Standard Highcharts series object. Customize the options for the generated regression series. Default: undefined

Exposed properties:

The plugin exposes properties to series[regressionSeries].options.regressionOutputs (Object)

Examples: