Trend Lines
- 3 minutes to read
This document provides a general overview of Trend Lines and describes how to draw a trend line between any two series points.
The document consists of the following sections.
#Trend Lines Overview
A Trend Line is a line drawn between any two points in a series, to show the general direction that values are headed towards. The Trend Line can be limited by these two points or extrapolated to infinity.
Trend Lines are often used in business analytics to show changes in data over time, using simple and understandable visuals. However, they suffer from a lack of scientific validity in cases where other potential changes can affect the data. For some scenarios it may be more appropriate to use Regression Lines, which are a more sophisticated analytical instrument.
A Trend Line is represented by an instance of the TrendLine class, which is a descendant of the Indicator class. The Trend Line resides in the IndicatorCollection of a series, which is accessible via the XYSeries2D.Indicators property.
A series can possess any number of Trend Lines, and it is possible to draw any number of these lines across the same series point.
The table below lists the main properties that affect the element's functionality and appearance.
Class | The Trend |
Availability | |
Argument and Value Level | Financial |
Specific Options | |
Appearance | Chart |
Visibility and Legend Availability | Indicator. |
#Draw a Trend Line
To access the collection of indicators for a series at design time, select the series (e.g. StockSeries2D), and click the ellipsis button for the XYSeries2D.Indicators property in the Properties window.
In the invoked Indicator Collection Editor: Indicators dialog, select Trend Line and click the Add button.
After a Trend Line is created, you can define its properties in the Indicator Collection Editor: Indicators dialog.
Since a Trend Line must be drawn across two points, define the argument (via the FinancialIndicator.Argument1 and FinancialIndicator.Argument2 properties) and the value level (via the FinancialIndicator.ValueLevel1 and FinancialIndicator.ValueLevel2 properties) for each point.
The TrendLine.ExtrapolateToInfinity property indicates whether the current Trend Line should be extrapolated beyond the end point's argument, or limited to this point.
A Trend Line's appearance is managed via its Indicator.Brush and Indicator.LineStyle properties.
To close the indicators' dialog, click the OK button, as shown in the image above.
Note that all of the chart's indicators are painted based on a palette defined via the ChartControl.IndicatorsPalette property.