Back to Devexpress

RangeAreaSeriesView Class

corelibraries-devexpress-dot-xtracharts-0cd5105b.md

latest8.9 KB
Original Source

RangeAreaSeriesView Class

A series view of the Range Area type.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class RangeAreaSeriesView :
    AreaSeriesView,
    IRangeAreaSeriesView,
    IRangeSeriesView
vb
Public Class RangeAreaSeriesView
    Inherits AreaSeriesView
    Implements IRangeAreaSeriesView,
               IRangeSeriesView

Remarks

The RangeAreaSeriesView class provides the functionality of a series view of the Range Area type within a chart control.

The RangeAreaSeriesView class inherits properties and methods from the base AreaSeriesView class which defines the common settings of area series views.

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 range area type, please see the Range Area Chart topic.

Example

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

namespace RangeAreaChart {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

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

            // Create a range area series.
            Series series1 = new Series("Series 1", ViewType.RangeArea);

            // Add points to them.
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 1), 2.08, 4.28));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 2), 2.42, 4.03));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 3), 2.78, 3.98));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 4), 2.57, 3.94));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 5), 2.69, 4.18));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 6), 2.69, 5.02));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 7), 2.36, 5.60));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 8), 1.97, 5.37));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 9), 2.76, 4.94));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 10), 3.54, 3.66));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 11), 4.31, 1.07));
            series1.Points.Add(new SeriesPoint(new DateTime(2008, 1, 12), 4.08, 0.09));

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

            // Access the view-type-specific options of the series.
            ((RangeAreaSeriesView)series1.View).Transparency = 80;

            // Access the type-specific options of the diagram.
            ((XYDiagram)rangeAreaChart.Diagram).AxisX.GridLines.Visible = true;
            ((XYDiagram)rangeAreaChart.Diagram).AxisY.WholeRange.MinValue = -0.5;
            ((XYDiagram)rangeAreaChart.Diagram).AxisY.WholeRange.MaxValue = 6;

            // Hide the legend (if necessary).
            rangeAreaChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;

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

            // Add the chart to the form.
            rangeAreaChart.Dock = DockStyle.Fill;
            this.Controls.Add(rangeAreaChart);
        }
    }
}
vb
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts

Namespace RangeAreaChart
    Partial Public Class Form1
        Inherits Form
        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ' Create a new chart.
            Dim rangeAreaChart As New ChartControl()

            ' Create a range area series.
            Dim series1 As New Series("Series 1", ViewType.RangeArea)

            ' Add points to them.
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 1), 2.08, 4.28))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 2), 2.42, 4.03))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 3), 2.78, 3.98))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 4), 2.57, 3.94))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 5), 2.69, 4.18))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 6), 2.69, 5.02))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 7), 2.36, 5.60))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 8), 1.97, 5.37))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 9), 2.76, 4.94))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 10), 3.54, 3.66))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 11), 4.31, 1.07))
            series1.Points.Add(New SeriesPoint(New DateTime(2008, 1, 12), 4.08, 0.09))

            ' Add a series to the chart.
            rangeAreaChart.Series.Add(series1)

            ' Access the view-type-specific options of the series.
            CType(series1.View, RangeAreaSeriesView).Transparency = 80

            ' Access the type-specific options of the diagram.
            CType(rangeAreaChart.Diagram, XYDiagram).AxisX.GridLines.Visible = True
            CType(rangeAreaChart.Diagram, XYDiagram).AxisY.WholeRange.MinValue = -0.5
            CType(rangeAreaChart.Diagram, XYDiagram).AxisY.WholeRange.MaxValue = 6

            ' Hide the legend (if necessary).
            rangeAreaChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False

            ' Add a title to the chart (if necessary).
            rangeAreaChart.Titles.Add(New ChartTitle())
            rangeAreaChart.Titles(0).Text = "A Range Area Chart"

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

Implements

IXtraSerializable

IXYSeriesView2D

IXtraSupportDeserializeCollectionItem

ISupportTransparency

Inheritance

Show 12 items

Object ChartElement SeriesViewBase XYDiagram2DSeriesViewBase XYDiagramSeriesViewBase SeriesViewColorEachSupportBase PointSeriesViewBase PointSeriesView LineSeriesView AreaSeriesViewBase AreaSeriesView RangeAreaSeriesView

See Also

RangeAreaSeriesView Members

DevExpress.XtraCharts Namespace