Information on this website refers to a deprecated product, and is provided only for historical reference. Please use the Version Switcher above to select an appropriate documentation website for the product you are using.

TrendLine

Type class

Trend lines are straight lines indicating trends, might also be used for some different purposes. Can be used by Serial and XY charts. To add/remove trend line, use chart.addTrendLine(trendLine)/chart.removeTrendLine(trendLine) methods or simply pass array of trend lines: chart.trendLines = [trendLine1, trendLine2] Example:

var trendLine = new AmCharts.TrendLine();
trendLine.initialDate = new Date(2012, 0, 2, 12); // 12 is hour - to start trend line in the middle of the day
trendLine.finalDate = new Date(2012, 0, 11, 12);
trendLine.initialValue = 10;
trendLine.finalValue = 19;
trendLine.lineColor = "#CC0000";
chart.addTrendLine(trendLine);

Inheritance

TrendLine does not extend any other symbol.

TrendLine is not extended by any other symbol.

Properties

dashLength
#

Type number

Default 0

Dash length.

finalCategory
#

Type string

Default

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

Default

Date to which trend line should be drawn. It should be date object and can only be used if chart parses dates.

finalValue
#

Type number

Default

Value at which trend line should end.

finalXValue
#

Type number

Default

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

initialCategory
#

Type string

Default

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

initialDate
#

Type Date

Default

Date from which trend line should start. It should be date object and can only be used if chart parses dates.

initialValue
#

Type number

Default

Value from which trend line should start.

initialXValue
#

Type number

Default

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

isProtected
#

Type boolean

Default 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 number

Default 1

Line opacity.

lineColor
#

Type string

Default #00CC00

Line color.

lineThickness
#

Type number

Default 1

Line thickness.

valueAxis
#

Type ValueAxis

Default

Value axis of the trend line. Will use first value axis of the chart if not set any.

valueAxisX
#

Type ValueAxis

Default

Used by XY chart only. X axis of trend line. Will use first X axis of the chart if not set any.

Methods

TrendLine does not have any methods.

Events

TrendLine does not have any events.

Adapters

TrendLine does not have any adapters.