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?
The direction of the lines on the graph works as a nice metaphor for the data: an upward slope indicates where values have increased and a downward slope indicates where values have decreased. The line's journey across the graph can create patterns that reveal trends in a dataset.
To calculate the trend line for the graph of a linear relationship, find the slope-intercept form of the line, y = mx + b, where x is the independent variable, y is the dependent variable, m is the slope of the line, and b is the y-intercept.
Trend lines can be composed of highs (resistance) or lows (support). To construct a trendline, simply connect either the high prices or low prices on a price chart. The resulting line is the trend line.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With