Back to Devexpress

RegressionLine Class

corelibraries-devexpress-dot-xtracharts-6c629a09.md

latest4.2 KB
Original Source

RegressionLine Class

Represents a Regression Line indicator.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class RegressionLine :
    SingleLevelIndicator
vb
Public Class RegressionLine
    Inherits SingleLevelIndicator

The following members return RegressionLine objects:

Remarks

The settings exposed via the RegressionLine class define the functionality of regression lines - one of the set of analytical tools provided by XtraCharts.

The RegressionLine objects reside in the IndicatorCollection returned by the XYDiagram2DSeriesViewBase.Indicators property.

A series can have an unlimited number of Regression Lines that correspond to any SingleLevelIndicator.ValueLevel.

For more information, see Regression Lines.

Example

This example demonstrates how a Regression Line can be displayed for a series of the Stock view type.

To access the series’ collection of indicators (via the XYDiagram2DSeriesViewBase.Indicators property), you should cast your series view to an appropriate type.

csharp
// Create a regression line for the Open value level.
RegressionLine myLine = new RegressionLine(ValueLevel.Open);

// Access the series collection of indicators,
// and add the regression line to it.
((StockSeriesView)chartControl1.Series[0].View).Indicators.Add(myLine);

// Customize the regression line's appearance.
myLine.LineStyle.DashStyle = DashStyle.DashDot;
myLine.LineStyle.Thickness = 2;
myLine.Color = Color.Crimson;
vb
' Create a regression line for the Open value level.
Dim myLine As New RegressionLine(ValueLevel.Open)

' Access the series collection of indicators,
' and add the regression line to it.
CType(chartControl1.Series(0).View, StockSeriesView).Indicators.Add(myLine)

' Customize the regression line's appearance.
myLine.LineStyle.DashStyle = DashStyle.DashDot
myLine.LineStyle.Thickness = 2
myLine.Color = Color.Crimson

Implements

IXtraSerializable

Inheritance

Object ChartElement ChartElementNamed Indicator SingleLevelIndicator RegressionLine

See Also

RegressionLine Members

Regression Lines

DevExpress.XtraCharts Namespace