The Line Chart is represented by the LineSeriesView object, which belongs to Point and Line Series Views. This view is useful when you need to show trends for several series on the same diagram, and to compare the values of several series for the same points arguments.
A Line chart is shown in the image below. Note that this chart type is based upon the XYDiagram, so it can be rotated to show lines either vertically or horizontally.

The table below lists the main characteristics of this chart type.
Feature |
Value |
Series View type |
LineSeriesView |
Diagram type |
2D-XYDiagram |
Number of arguments per series point |
1 |
Number of values per series point |
1 |
The following example demonstrates how to create a 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
|