Back to Devexpress

FunnelSeriesView Class

corelibraries-devexpress-dot-xtracharts-e48ba2a8.md

latest7.2 KB
Original Source

FunnelSeriesView Class

Represents a series view of the Funnel type.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class FunnelSeriesView :
    FunnelSeriesViewBase,
    ISimpleDiagram2DSeriesView,
    IColorEachSupportView
vb
Public Class FunnelSeriesView
    Inherits FunnelSeriesViewBase
    Implements ISimpleDiagram2DSeriesView,
               IColorEachSupportView

Remarks

The FunnelSeriesView class provides the functionality of a series view of the Funnel type within a chart control.

In addition to the common view settings inherited from the base SeriesViewBase class, the FunnelSeriesView class declares the funnel type specific settings, which allow you to enable the auto-calculation of a funnel’s height-to-width ratio (the FunnelSeriesView.HeightToWidthRatioAuto property), to control a funnel’s alignment with respect to the position of its labels (the FunnelSeriesView.AlignToCenter property), and a funnel’s appearance (the FunnelSeriesView.Border and FunnelSeriesView.FillStyle properties).

Note that a particular view type can be defined for a series via its SeriesBase.View property.

For more information, refer to Funnel Series View.

Example

The example demonstrates how to create a ChartControl with a series of the FunnelSeriesView type, and add this chart to a form at runtime.

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

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

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

            // Create a funnel series.
            Series series1 = new Series("A Funnel Series", ViewType.Funnel);

            // Add points to the series.
            series1.Points.Add(new SeriesPoint("A", 48.5));
            series1.Points.Add(new SeriesPoint("B", 29.6));
            series1.Points.Add(new SeriesPoint("C", 17.1));
            series1.Points.Add(new SeriesPoint("D", 13.3));
            series1.Points.Add(new SeriesPoint("E", 11.6));

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

            // Adjust the view-type specific properties of the series.
            FunnelSeriesView myView = (FunnelSeriesView)series1.View;

            myView.Titles.Add(new SeriesTitle());
            myView.Titles[0].Text = series1.Name;
            myView.HeightToWidthRatioAuto = false;
            myView.HeightToWidthRatio = 1.5;
            myView.PointDistance = 10;

            // Adjust the point options of the series.
            series1.Label.TextPattern = "{A}: {VP:p0}";

            // Specify the series labels position.
            ((FunnelSeriesLabel)series1.Label).Position = FunnelSeriesLabelPosition.RightColumn;

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

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

Namespace Series_Funnel
    Partial Public Class Form1
        Inherits Form

        Public Sub New()
            InitializeComponent()
        End Sub

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

            ' Create a funnel series.
            Dim series1 As New Series("A Funnel Series", ViewType.Funnel)

            ' Add points to the series.
            series1.Points.Add(New SeriesPoint("A", 48.5))
            series1.Points.Add(New SeriesPoint("B", 29.6))
            series1.Points.Add(New SeriesPoint("C", 17.1))
            series1.Points.Add(New SeriesPoint("D", 13.3))
            series1.Points.Add(New SeriesPoint("E", 11.6))

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

            ' Adjust the view-type specific properties of the series.
            Dim myView As FunnelSeriesView = CType(series1.View, FunnelSeriesView)

            myView.Titles.Add(New SeriesTitle())
            myView.Titles(0).Text = series1.Name
            myView.HeightToWidthRatioAuto = False
            myView.HeightToWidthRatio = 1.5
            myView.PointDistance = 10

            ' Adjust the point options of the series.
            series1.Label.TextPattern = "{A}: {VP:p0}"

            ' Specify the series labels position.
            CType(series1.Label, FunnelSeriesLabel).Position = FunnelSeriesLabelPosition.RightColumn

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

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

Implements

IXtraSerializable

IXtraSupportDeserializeCollectionItem

Inheritance

Object ChartElement SeriesViewBase SimpleDiagramSeriesViewBase FunnelSeriesViewBase FunnelSeriesView

See Also

FunnelSeriesView Members

Funnel Series View

DevExpress.XtraCharts Namespace