Back to Devexpress

BoxPlotDrawOptions.Border Property

corelibraries-devexpress-dot-xtracharts-dot-boxplotdrawoptions-c51618b1.md

latest4.3 KB
Original Source

BoxPlotDrawOptions.Border Property

Returns border settings for Box Plot series points.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public RectangularBorder Border { get; }
vb
Public ReadOnly Property Border As RectangularBorder

Property Value

TypeDescription
RectangularBorder

An object that stores border options.

|

Example

This example shows how to customize the appearance of specific Box Plot series based on a given condition when the chart control renders its series.

In the ChartControl.CustomDrawSeries (WebChartControl.CustomDrawSeries) event handler, use the Series and SeriesDrawOptions properties to access a series and its drawing options.

csharp
using DevExpress.XtraCharts;
using System;
using System.Drawing;
using System.Windows.Forms;
//...
    private void Form1_Load(object sender, EventArgs e) {
        Series series = new Series("Box Plot", ViewType.BoxPlot);
        series.DataSource = DataPoint.GetDataPoints();
        series.SetBoxPlotDataMembersWithOutliers("Argument", "Min", "Quartile1", "Median", "Quartile3", "Max", "Mean", "Outliers");
        chartControl1.Series.Add(series);

        chartControl1.CustomDrawSeries += ChartControl1_CustomDrawSeries;
    }

    private void ChartControl1_CustomDrawSeries(object sender, CustomDrawSeriesEventArgs e) {
        // Find all Box Plot series and define their color.
        if (e.Series.View is BoxPlotSeriesView)
            e.SeriesDrawOptions.Color = Color.Orange;

        // Find a series by its name and define its border color.
        if (e.Series.Name == "Box Plot")
            ((BoxPlotDrawOptions)e.SeriesDrawOptions).Border.Color = Color.Black;

        // Find all Box Plot series by the type of their DrawOptions
        // and specify the series fill style.
        if (e.SeriesDrawOptions.GetType() == typeof(BoxPlotDrawOptions))
            ((BoxPlotDrawOptions)e.SeriesDrawOptions).FillStyle.FillMode = FillMode.Gradient;
    }
vb
Imports DevExpress.XtraCharts
Imports System.Windows.Forms
'...
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim series As Series = New Series("Box Plot", ViewType.BoxPlot)
        series.DataSource = DataPoint.GetDataPoints()
        series.SetBoxPlotDataMembersWithOutliers("Argument", "Min", "Quartile1", "Median", "Quartile3", "Max", "Mean", "Outliers")
        chartControl1.Series.Add(series)
        chartControl1.CustomDrawSeries += AddressOf ChartControl1_CustomDrawSeries
    End Sub

    Private Sub ChartControl1_CustomDrawSeries(ByVal sender As Object, ByVal e As CustomDrawSeriesEventArgs)
        ' Find all Box Plot series and define their color.
        If TypeOf e.Series.View Is BoxPlotSeriesView Then e.SeriesDrawOptions.Color = Color.Orange

        ' Find a series by its name and define its border color.
        If e.Series.Name Is "Box Plot" Then CType(e.SeriesDrawOptions, BoxPlotDrawOptions).Border.Color = Color.Black

        ' Find all Box Plot series by the type of their DrawOptions
        ' and specify the series fill style.
        If e.SeriesDrawOptions.GetType Is GetType(BoxPlotDrawOptions) Then CType(e.SeriesDrawOptions, BoxPlotDrawOptions).FillStyle.FillMode = FillMode.Gradient
    End Sub

See Also

BoxPlotDrawOptions Class

BoxPlotDrawOptions Members

DevExpress.XtraCharts Namespace