corelibraries-devexpress-dot-xtracharts-dot-regressionlines-dot-item-x28-devexpress-dot-xtracharts-dot-valuelevel-x29.md
Provides access to individual Regression Lines in the collection, by their value levels.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[Browsable(false)]
public RegressionLine this[ValueLevel valueLevel] { get; set; }
<Browsable(False)>
Public Property Item(valueLevel As ValueLevel) As RegressionLine
| Name | Type | Description |
|---|---|---|
| valueLevel | ValueLevel |
A ValueLevel enumeration value, identifying the Regression Line.
|
| Type | Description |
|---|---|
| RegressionLine |
A RegressionLine object which represents the Regression Line.
|
Use this property to access Regression Lines by their value levels.
Note
An individual Regression Line is identified within the collection by its value level, rather than by a zero-based index, as it would be in a conventional collection.
Most series view types support only a single value per each argument for their points. So, to display a Regression Line for these series, the Item property should be set to Value. And, for view types that support multiple values per each argument (such as Bubble or Stock), set the Item property to the required value level.
For more information, refer to Regression Lines.
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;
' 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
See Also