| Charting Data > Working with TrendLines > Creating TrendLines |
TrendLines can be created at design time using the TrendLine Collection Editor. Using the collection editor, you may add, modify and remove trend lines. For more information on the TrendLine Collection Editor, see TrendLine Collection Editor.
To create a TrendLine programmatically, create instance of TrendLine object and set its properties. The TrendLine can be created using its constructor or AddNewTrendLine.TrendLinesCollection() method of TrendLinesCollection.
The following code adds a red TrendLine to ChartGroup(0) of the Chart:
To write code in Visual Basic
To write code in C#
This topic illustrates the following:

The red trend line connects the first and last data points.