Back to Devexpress

AreaEmptyPointOptions Class

corelibraries-devexpress-dot-xtracharts-ff25fc51.md

latest10.6 KB
Original Source

AreaEmptyPointOptions Class

Contains empty point options for area series views and their descendants.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class AreaEmptyPointOptions :
    EmptyPointOptions
vb
Public Class AreaEmptyPointOptions
    Inherits EmptyPointOptions

The following members return AreaEmptyPointOptions objects:

Remarks

The AreaEmptyPointOptions class introduces the following options:

  • Border – Specifies border settings for empty point areas.
  • FillStyle – Specifies fill settings for empty point areas.

Refer to the following help topic for more information: Empty Points.

Example

How to: Display Area Chart Empty Points

This example shows how to customize display options for empty points of an area series view.

Cast the AreaSeriesViewBase.EmptyPointOptions property to the AreaEmptyPointOptions type to access an area series’ empty point settings.

Specify the ProcessPoints property to define how the chart handles empty points. In this example, the chart calculates mock values for empty points.

csharp
using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace EmptyPointRepsentation {
    public partial class Form1 : Form {
        ChartControl chart { get { return chartControl1; } }
        public Form1() {
            InitializeComponent();

            chart.DataSource = WeatherDataProvider.Data;
            Series series = new Series("Wind", ViewType.Area);
            series.SetDataMembers("Date", "Wind");
            chart.Series.Add(series);

            AreaSeriesView view = (AreaSeriesView)series.View;

            view.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
            AreaEmptyPointOptions areaEmptyPointOptions = view.EmptyPointOptions;
            areaEmptyPointOptions.ProcessPoints = ProcessEmptyPointsMode.Interpolate;
            areaEmptyPointOptions.FillStyle.FillMode = FillMode.Solid;
            areaEmptyPointOptions.Color = Color.DarkGray;
            areaEmptyPointOptions.Border.Color = Color.Gray;
            areaEmptyPointOptions.Border.Thickness = 2;

        }
    }

    public static class WeatherDataProvider {
        static List<WeatherPoint> data;

        public static List<WeatherPoint> Data {
            get {
                if (data == null)
                    InitCollection();
                return data;
            }
        }
        static void InitCollection() {
            data = new List<WeatherPoint>();
            int lastYear = DateTime.Now.Year - 1;
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 10) });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 11), Wind = 5 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 12), Wind = 5 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 13), Wind = 6 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 14), Wind = 3 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 15) });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 16), Wind = 6 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 17), Wind = 5 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 18), Wind = 5 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 19), Wind = 4 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 20), Wind = 3 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 21), Wind = 7 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 22), Wind = 2 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 23) });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 24) });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 25), Wind = 4 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 26), Wind = 5 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 27), Wind = 4 });
            data.Add(new WeatherPoint() { Date = new DateTime(lastYear, 7, 28), Wind = 4 });
        }

        public class WeatherPoint {
            public DateTime Date { get; set; }
            public double? Wind { get; set; }
        }
    }
}
vb
Imports DevExpress.XtraCharts
Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Windows.Forms

Namespace EmptyPointRepsentation
    Public Partial Class Form1
        Inherits Form

        Private ReadOnly Property chart As ChartControl
            Get
                Return chartControl1
            End Get
        End Property

        Public Sub New()
            InitializeComponent()
            chart.DataSource = Data
            Dim series As Series = New Series("Wind", ViewType.Area)
            series.SetDataMembers("Date", "Wind")
            chart.Series.Add(series)
            Dim view As AreaSeriesView = CType(series.View, AreaSeriesView)
            view.MarkerVisibility = DevExpress.Utils.DefaultBoolean.[True]
            Dim areaEmptyPointOptions As AreaEmptyPointOptions = view.EmptyPointOptions
            areaEmptyPointOptions.ProcessPoints = ProcessEmptyPointsMode.Interpolate
            areaEmptyPointOptions.FillStyle.FillMode = FillMode.Solid
            areaEmptyPointOptions.Color = Color.DarkGray
            areaEmptyPointOptions.Border.Color = Color.Gray
            areaEmptyPointOptions.Border.Thickness = 2
        End Sub
    End Class

    Public Module WeatherDataProvider
        Private dataField As List(Of WeatherPoint)

        Public ReadOnly Property Data As List(Of WeatherPoint)
            Get
                If dataField Is Nothing Then Call InitCollection()
                Return dataField
            End Get
        End Property

        Private Sub InitCollection()
            dataField = New List(Of WeatherPoint)()
            Dim lastYear As Integer = Date.Now.Year - 1
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 10)
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 11),
                .Wind = 5
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 12),
                .Wind = 5
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 13),
                .Wind = 6
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 14),
                .Wind = 3
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 15)
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 16),
                .Wind = 6
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 17),
                .Wind = 5
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 18),
                .Wind = 5
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 19),
                .Wind = 4
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 20),
                .Wind = 3
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 21),
                .Wind = 7
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 22),
                .Wind = 2
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 23)
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 24)
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 25),
                .Wind = 4
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 26),
                .Wind = 5
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 27),
                .Wind = 4
            })
            Call dataField.Add(New WeatherPoint() With {
                .[Date] = New DateTime(lastYear, 7, 28),
                .Wind = 4
            })
        End Sub

        Public Class WeatherPoint
            Public Property [Date] As Date
            Public Property Wind As Double?
        End Class
    End Module
End Namespace

Inheritance

Object ChartElement EmptyPointOptions AreaEmptyPointOptions

See Also

AreaEmptyPointOptions Members

DevExpress.XtraCharts Namespace