user2633291
user2633291

Reputation: 165

Does Highcharts have a "trend line" feature?

Basically, I'm trying to have Highcharts automatically draw a straight line going from the first data point to the last, so that I can see the "overall trend" more easily.

I believe this is called a "trend line" or something, but I have not found anything in the documentation related to that. It is very possible that it still has this feature, however. Does it?

Upvotes: 7

Views: 19657

Answers (4)

Paweł Fus
Paweł Fus

Reputation: 45079

Since Highcharts Stock v7, trendline is officially supported.

More details can be found in API.

Demo: https://jsfiddle.net/BlackLabel/bd8gc1ya/

Basic config:

{
  type: 'trendline',
  linkedTo: 'aapl',
  marker: {
    enabled: false
  }
}

Upvotes: 1

divya yandra
divya yandra

Reputation: 1

HighCharts have trend line feature. check https://www.highcharts.com/products/plugin-registry/single/22/Highcharts%20regression

check this JSFiddle also http://jsfiddle.net/3g4ryLc9/539/

 series: [{
  regression: true,
  regressionSettings: {
    name : 'Type any name of the series..',
    type: 'polynomial',
    color: 'rgba(223, 183, 83, .9)',
    dashStyle: 'solid'
  },
  name: 'Test input',
  color: 'rgba(223, 83, 83, .5)',
  data: [
    [1, 1],
    [2, 3],
    [3, 9],

  ]

Upvotes: 0

Ojen
Ojen

Reputation: 837

Highcharts does not support this out of the box, but there are some plugins in their gallery that do trend lines.

This one for example (which we have used with success), gives multiple options including linear trend and moving averages: http://www.highcharts.com/plugin-registry/single/16/technical-indicators

UPDATE May 2018:

Highcharts now includes this functionality as part of its core offering.

https://www.highcharts.com/docs/chart-and-series-types/technical-indicator-series

Upvotes: 2

thtsigma
thtsigma

Reputation: 4938

As far as I am aware, highcharts does not calculate a regression or trend lines. There are some plugins that you may be able to use. Here is one that i've found, i'm sure there are others: https://github.com/virtualstaticvoid/highcharts_trendline

Upvotes: 5

Related Questions