[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Collapse]Chart Elements
     Breadcrumbs
    [Collapse]Series
     [Collapse]Indicators
      [Collapse]Simple Indicators
        Regression Lines
        Trend Lines
       Fibonacci Indicators
       Moving Average and Envelope
       Oscillator Indicators
       Trend Indicators
       Price Indicators
       Error Bars
      Series Points
      Series Point Labels
      Total Labels
      Series Titles
    [Expand]Diagram
     Chart Titles
    [Expand]Legends
    [Expand]Annotations
   [Expand]Providing Data
   [Expand]Data Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Additional Resources
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Regression Lines

This document describes how a linear regression analysis can be performed over your chart's visual data. XtraCharts introduces the Regression Line to accomplish this.

This document consists of the following sections.

Expanded Regression Lines Overview

A Regression Line is a used statistical analysis instrument. Appearing as a line drawn across a chart's diagram, it is constructed based on the so-called linear regression analysis.

A Regression Line differs from a Trend Line in that is a straight line indicating whether a particular data set has increased or decreased over a period of time. Trend Lines are sometimes used in business analytics to show changes in data over time because they are simple. However, they suffer from a lack of scientific validity in cases where other potential changes can affect the data. Thus, regression lines are a more sophisticated analytical instrument.

Regression Lines determine whether the data suggests some kind of simple function between its variables. (In general, there are one or more independent variables and a single dependent variable, the values of which depend on the values of the other variables). Linear regression analysis involves determining the underlying equation through a method called least squares. This method minimizes the error terms depending on how far away each data point is from the underlying linear function. Thus, the method by minimizes the sum of the squares of the errors.

A Regression Line is represented by an instance of the RegressionLine class (which is a descendant of the Indicator class) and (along with other indicators) resides in the IndicatorCollection of a series returned by the XYDiagram2DSeriesViewBase.Indicators property.

Since a RegressionLine object is inherited from the SingleLevelIndicator class, to draw a Regression Line, you must specify its SingleLevelIndicator.ValueLevel property.

Note

Because a regression line is built upon a specified value level, it is used to deal with either date-time or numerical data. Thus, you cannot create a Regression Line upon series arguments, nor for any data of the qualitative scale type.

The view type of the series to which a Regression Line is assigned is returned by the Indicator.View property.

A series can possess any number of Regression Lines and any number of them can be drawn across the same value level.

Expanded Draw a Regression Line

To access a series' collection of indicators at design time, select the series and in the Properties window, expand its SeriesBase.View property, then click the ellipsis button for the XYDiagram2DSeriesViewBase.Indicators property.

In the invoked Indicators dialog, click the Add... button, and in the invoked Indicator Type dialog, choose Regression Line and click OK.

After a Regression Line is created, you can define its SingleLevelIndicator.ValueLevel and other properties in the Indicators dialog.

Note that all the chart's indicators are painted based on a palette defined via the ChartControl.IndicatorsPaletteName property.

Expanded See Also

Is this topic helpful?​​​​​​​