Skip to content

TrendLine

Type class

Creates a trendline for AmSerialChart and AmXYChart charts which indicates the trend of your data or covers some different purposes. Multiple can be assigned.

Example

```js var chart = AmCharts.makeChart("chartdiv",{ ... "trendLines": [ { "initialValue": 1, "initialXValue": 1, "finalValue": 11, "finalXValue": 12 } ] });```

Sources

This information about TrendLine is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

TrendLine does not extend any other symbol.

TrendLine is not extended by any other symbol.

Properties

balloonText

Type string

When set, enables displaying a roll-over balloon.

dashLength

Type numberDefault 0

Dash length.

finalCategory

Type string

String, equal to category value to which trend line should be drawn. It should be used if chart doesn't parse dates.

finalDate

Type date

Date to which trend line should be drawn. It can be date string (using the same date format as chart.dataDateFormat) or date object.

finalImage

Type Image

Allows to add an image to the end of a trend line.

finalValue

Type number

Value at which trend line should end.

finalXValue

Type number

Used by XY chart only. X value at which trend line should end.

id

Type string

Unique id of a Trend line. You don't need to set it, unless you want to.

initialCategory

Type string

String, equal to category value from which trend line should start. It should be used if chart doesn't parse dates.

initialDate

Type date

Date from which trend line should start. It can be date string (using the same date format as chart.dataDateFormat) or date object.

initialImage

Type Image

Allows to add an image to the beginning of a trend line.

initialValue

Type number

Value from which trend line should start.

initialXValue

Type number

Used by XY chart only. X value from which trend line should start.

isProtected

Type booleanDefault false

Used by Stock chart. If this property is set to true, this trend line won't be removed when clicked on eraser tool.

lineAlpha

Type numberDefault 1

Line opacity.

lineColor

Type colorDefault #00CC00

Line color.

lineThickness

Type numberDefault 1

Line thickness.

Methods

TrendLine does not have any methods.

Events

click

Param { type: "click", target: TrendLine } & {type: "click", TrendLine, chart:AmRectangularChart}

Dispatched when user clicks on a trend line.

rollOut

Param { type: "rollOut", target: TrendLine } & {type: "rollOut", TrendLine, chart:AmRectangularChart}

Dispatched when user rolls out of a trend line.

rollOver

Param { type: "rollOver", target: TrendLine } & {type: "rollOver", TrendLine, chart:AmRectangularChart}

Dispatched when user clicks rolls-over a trend line.