Add trend line calculation

A feature to calculate a trend line from a series.