The LineSeriesView class provides the functionality of a series view of the line type within a chart control. At the same time, the LineSeriesView class serves as a base for the StepLineSeriesView class.
In addition to the common view settings inherited from the base PointSeriesView class, the LineSeriesView class declares the line type specific settings which allow you to define the style of lines (LineStyle) and the settings of line markers (LineMarkerOptions).
Note that a particular view type can be defined for a series via its SeriesBase.View property.
For more information on series views of the stacked bar type please see the Line Chart topic.

Example
The following example demonstrates how to create a DevExpress.XtraCharts.ChartControl with a series of the LineSeriesView type, and add this chart to a form at runtime. Before proceeding with this example, first create a Windows Forms Application in Visual Studio, and include all necessary assemblies to the References list of your project.
Then, add the following code to the Form.Load event handler.
C# |
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
private void Form1_Load(object sender, EventArgs e) {
ChartControl lineChart = new ChartControl();
Series series1 = new Series("Series 1", ViewType.Line);
series1.Points.Add(new SeriesPoint(1, 2));
series1.Points.Add(new SeriesPoint(2, 12));
series1.Points.Add(new SeriesPoint(3, 14));
series1.Points.Add(new SeriesPoint(4, 17));
lineChart.Series.Add(series1);
series1.ArgumentScaleType = ScaleType.Numerical;
((LineSeriesView)series1.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
((LineSeriesView)series1.View).LineMarkerOptions.Kind = MarkerKind.Triangle;
((LineSeriesView)series1.View).LineStyle.DashStyle = DashStyle.Dash;
((XYDiagram)lineChart.Diagram).EnableAxisXZooming = true;
lineChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
lineChart.Titles.Add(new ChartTitle());
lineChart.Titles[0].Text = "A Line Chart";
lineChart.Dock = DockStyle.Fill;
this.Controls.Add(lineChart);
}
|
VB |
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Load
Dim lineChart As New ChartControl()
Dim series1 As New Series("Series 1", ViewType.Line)
series1.Points.Add(New SeriesPoint(1, 2))
series1.Points.Add(New SeriesPoint(2, 12))
series1.Points.Add(New SeriesPoint(3, 14))
series1.Points.Add(New SeriesPoint(4, 17))
lineChart.Series.Add(series1)
series1.ArgumentScaleType = ScaleType.Numerical
CType(series1.View,LineSeriesView).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True
CType(series1.View, LineSeriesView).LineMarkerOptions.Kind = MarkerKind.Triangle
CType(series1.View, LineSeriesView).LineStyle.DashStyle = DashStyle.Dash
CType(lineChart.Diagram, XYDiagram).EnableAxisXZooming = True
lineChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False
lineChart.Titles.Add(New ChartTitle())
lineChart.Titles(0).Text = "A Line Chart"
lineChart.Dock = DockStyle.Fill
Me.Controls.Add(lineChart)
End Sub
|