Back to Devexpress

Regression Lines

wpf-14328-controls-and-libraries-charts-suite-chart-control-series-indicators-simple-indicators-regression-lines.md

latest2.2 KB
Original Source

Regression Lines

  • May 28, 2021

A Regression Line is a series indicator that allows you to perform linear regression analysis over series points. The analysis aims to find a line that is as close to all series’s points as possible using the method of least squares to determine the underlying line’s equation.

How to Add a Regression Line to a Chart

The following markup shows how to build a regression line based on a stock series‘s High values:

xaml
<dxc:StockSeries2D.Indicators> 
    <dxc:RegressionLine ValueLevel="High" 
                        ShowInLegend="True" 
                        LegendText="Regression Line"/>
</dxc:StockSeries2D.Indicators>

The code above uses the following classes and properties:

Class or PropertyDescription
XYSeries2D.IndicatorsThe series indicators’ collection.
RegressionLineThe regression line.
RegressionLine.ValueLevelSpecifies a point value used to build a regression line.
Indicator.ShowInLegendSpecifies whether to show a regression line in the legend.
Indicator.LegendTextSpecifies the text that indicates the indicator in the legend.

See Also

Trend Lines

Fibonacci Indicators

Moving Average and Envelope