RegressionLines.Item[ValueLevel] Property
Provides access to individual Regression Lines in the collection, by their value levels.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
[Browsable(false)]
[NonTestableProperty]
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
public RegressionLine this[ValueLevel valueLevel] { get; set; }
Parameters
Name | Type | Description |
---|---|---|
valueLevel | ValueLevel | A ValueLevel enumeration value, identifying the Regression Line. |
Property Value
Type | Description |
---|---|
RegressionLine | A RegressionLine object which represents the Regression Line. |
Remarks
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.
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;