Search results

Trendline API in JavaScript Chart API control

Configures the behavior and appearance of trendlines in a chart series. Trendlines indicate trends and the rate of price changes over a period.

Properties

animation

AnimationModel

Options to customize the animation for trendlines.

backwardForecast

number

Defines the period by which the trend is to be backward forecasted.

Defaults to 0

dashArray

string

Configures the pattern of dashes and gaps in the trendline stroke using the dashArray property.

Defaults to

enableTooltip

boolean

Enables or disables the tooltip for the trendline using the enableTooltip property. By default, it is set to true.

Defaults to true

fill

string

The fill color for the trendline, which accepts values in hex or rgba as valid CSS color strings.

Defaults to

forwardForecast

number

Defines the period by which the trend must be forward forecasted.

Defaults to 0

intercept

number

Specifies the intercept value of the trendline.

Defaults to null

legendShape

LegendShape

The legendShape property defines the shape used to represent the trendline in the chart legend.

Defaults to ‘SeriesType’

marker

MarkerSettingsModel

Options for customizing the markers for trendlines, including shape, size, color, and other visual aspects.

name

string

The name property is used to assign a descriptive name to the trendline, which will be displayed in the chart as a legend.

Defaults to

period

number

Defines the period, the price changes over which will be considered to predict the moving average trendline.

Defaults to 2

polynomialOrder

number

Defines the polynomial order of the polynomial trendline.

Defaults to 2

type

TrendlineTypes

Defines the type of trendline used in the series. Available types are:

  • Linear - A straight line that shows the general direction of data.
  • Exponential - A curve that fits data with exponential growth or decay.
  • Polynomial - A curve that fits data with a polynomial function.
  • Power - A curve that represents data with a power function.
  • Logarithmic - A curve that fits data with a logarithmic scale.
  • MovingAverage - A trendline that smoothens data using a moving average calculation.

Defaults to ‘Linear’

visible

boolean

The visible property controls the display of the trendline. If set to true, the trendline will be rendered on the chart. If set to false, the trendline will be hidden.

Defaults to true

width

number

Defines the width of the trendline.

Defaults to 1