trendLine Item

The nested element trendLine was developed as a part of the improvements for the series element. It enables the user to set up trend line displaying for chart series.  See a more detailed description of the Series element in the developer site.

NOTE. Trend lines can be used for all chart types, except for pie and radar charts. If the chart type changes to pie or radar, the trend lines corresponding to data, are lost.

Attributes of the TrendLine Element

Attribute name Brief description
type

The type attribute specifies trend line type. Available values:

  • Linear. Linear.

  • Logarithmic. Logarithmic.

  • Exponential. Exponential.

  • Power. Power.

  • Mean. Mean.

  • Peaks. Peak values.

name

The name attribute sets trend line name. Names can be random or set automatically. When the names are automatic, one of the default values is created depending on the selected line type:

  • Linear Trend.

  • Logarithmic Trend.

  • Exponential Trend.

  • Power Trend.

  • Mean.

  • Peak Values.

backwardForecast

The backwardForecast attribute sets the number of backward forecast points.

forwardForecast

The forwardForecast attribute sets the number of forward forecast points.

Peaks

The Peaks attribute sets peak interval. This is relevant only for Peaks type trend line.

useAutomaticText

The useAutomaticText attribute indicates whether to use auto name for trend line. Available values:

  • True. Use auto name for trend line.

  • False. Use custom name for trend line.

showInLegend

The showInLegend attribute determines whether trend line is shown in chart legend. Available values:

  • True. Show trend line in the chart legend.

  • False. Do not show trend line in the chart legend.

lineWidth

The lineWidth attribute sets trend line width.

lineColor

The lineColor attribute defines trend line color.

dashStyle

The dashStyle attribute defines trend line style. Available values:

  • Solid. Solid line.

  • Dash. Dotted line.

  • Dot. Dashed line.

  • Longdash. Long dashes.

Various combinations of these variants are possible.

Example

The example of using the trendLine element is given on the Chart Trend Line Setup page.

See also:

HighCharts Improvements | Chart Trend Line Setup