RegressionLine Class
Represents a Regression Line indicator.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v18.1.dll
Declaration
[TypeConverter(typeof(RegressionLineTypeConverter))]
public class RegressionLine :
SingleLevelIndicator
Related API Members
The following members accept/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.
// 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;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the RegressionLine class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.