Back to Devexpress

StepLineSeriesView Class

corelibraries-devexpress-dot-xtracharts-cc9c4e04.md

latest6.9 KB
Original Source

StepLineSeriesView Class

Represents a series view of the Step Line type.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class StepLineSeriesView :
    LineSeriesView,
    ILineSeriesView,
    IStepSeriesView
vb
Public Class StepLineSeriesView
    Inherits LineSeriesView
    Implements ILineSeriesView,
               IStepSeriesView

Remarks

The StepLineSeriesView class provides the functionality of a series view of the step line type within a chart control.

In addition to the common line view settings inherited from the base LineSeriesView class, the StepLineSeriesView class declares a step line type specific setting which allows you to control the manner in which step lines are drawn within the view (StepLineSeriesView.InvertedStep).

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 step line type please see the Step Line Chart topic.

Example

The following example demonstrates how to create a ChartControl with a series of the StepLineSeriesView 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.

csharp
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...

private void Form1_Load(object sender, EventArgs e) {
    // Create a new chart.
    ChartControl stepLineChart = new ChartControl();

    // Create a step line series.
    Series series1 = new Series("Series 1", ViewType.StepLine);

    // Add points to it.
    series1.Points.Add(new SeriesPoint("A", 12));
    series1.Points.Add(new SeriesPoint("B", 4));
    series1.Points.Add(new SeriesPoint("C", 17));
    series1.Points.Add(new SeriesPoint("D", 7));
    series1.Points.Add(new SeriesPoint("E", 12));
    series1.Points.Add(new SeriesPoint("F", 4));
    series1.Points.Add(new SeriesPoint("G", 17));
    series1.Points.Add(new SeriesPoint("H", 7));

    // Add the series to the chart.
    stepLineChart.Series.Add(series1);

    // Customize the view-type-specific properties of the series.
    StepLineSeriesView myView = (StepLineSeriesView)series1.View;
    myView.LineMarkerOptions.Kind = MarkerKind.Star;
    myView.LineMarkerOptions.StarPointCount = 5;
    myView.LineStyle.DashStyle = DashStyle.Dash;

    // Access the diagram's options.
    ((XYDiagram)stepLineChart.Diagram).EnableAxisXZooming = true;

    // Hide the legend (if necessary).
    stepLineChart.Legend.Visible = false;

    // Add a title to the chart (if necessary).
    stepLineChart.Titles.Add(new ChartTitle());
    stepLineChart.Titles[0].Text = "A Step Line Chart";

    // Add the chart to the form.
    stepLineChart.Dock = DockStyle.Fill;
    this.Controls.Add(stepLineChart);
}
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
    ' Create a new chart.
    Dim stepLineChart As New ChartControl()

    ' Create a step line series.
    Dim series1 As New Series("Series 1", ViewType.StepLine)

    ' Add points to it.
    series1.Points.Add(New SeriesPoint("A", 12))
    series1.Points.Add(New SeriesPoint("B", 4))
    series1.Points.Add(New SeriesPoint("C", 17))
    series1.Points.Add(New SeriesPoint("D", 7))
    series1.Points.Add(New SeriesPoint("E", 12))
    series1.Points.Add(New SeriesPoint("F", 4))
    series1.Points.Add(New SeriesPoint("G", 17))
    series1.Points.Add(New SeriesPoint("H", 7))

    ' Add the series to the chart.
    stepLineChart.Series.Add(series1)

    ' Customize the view-type-specific properties of the series.
    Dim myView As StepLineSeriesView = CType(series1.View, StepLineSeriesView)
    myView.LineMarkerOptions.Kind = MarkerKind.Star
    myView.LineMarkerOptions.StarPointCount = 5
    myView.LineStyle.DashStyle = DashStyle.Dash

    ' Access the diagram's options.
    CType(stepLineChart.Diagram, XYDiagram).EnableAxisXZooming = True

    ' Hide the legend (if necessary).
    stepLineChart.Legend.Visible = False

    ' Add a title to the chart (if necessary).
    stepLineChart.Titles.Add(New ChartTitle())
    stepLineChart.Titles(0).Text = "A Step Line Chart"

    ' Add the chart to the form.
    stepLineChart.Dock = DockStyle.Fill
    Me.Controls.Add(stepLineChart)
End Sub

Implements

IXtraSerializable

IXYSeriesView2D

IXtraSupportDeserializeCollectionItem

Inheritance

Object ChartElement SeriesViewBase XYDiagram2DSeriesViewBase XYDiagramSeriesViewBase SeriesViewColorEachSupportBase PointSeriesViewBase PointSeriesView LineSeriesView StepLineSeriesView

See Also

StepLineSeriesView Members

PointSeriesView

LineSeriesView

DevExpress.XtraCharts Namespace