Back to Devexpress

FunnelSeriesLabel.Position Property

corelibraries-devexpress-dot-xtracharts-dot-funnelserieslabel.md

latest10.1 KB
Original Source

FunnelSeriesLabel.Position Property

Gets or sets the position of labels relative to each other and the funnel diagram.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public FunnelSeriesLabelPosition Position { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property Position As FunnelSeriesLabelPosition

Property Value

TypeDescription
FunnelSeriesLabelPosition

A FunnelSeriesLabelPosition enumeration value determining the position of a label against the corresponding series point.

|

Available values:

NameDescription
LeftColumn

The labels are organized into a straight column on the left of the funnel series points.

| | Left |

The labels are displayed on the left of the funnel series points.

| | Center |

The labels are displayed in the center of the funnel series points.

| | Right |

The labels are displayed on the right of the funnel series points.

| | RightColumn |

The labels are organized into a straight column on the right of the funnel series points.

|

Remarks

Refer to the FunnelSeriesLabelPosition enumeration’s description for a list of the available label positions.

For more information, refer to Series Points.

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the Position property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items/CS/TutorialsCustomItems/CustomItems/FunnelItemControlProvider.cs#L61

csharp
}
((FunnelSeriesLabel)series.Label).Position = FunnelSeriesLabelPosition.Center;
return series;

bi-dashboard-non-visual-custom-export/CS/DashboardExporterApp/ExportControlProviders/FunnelItemExportControlProvider.cs#L40

csharp
}
((FunnelSeriesLabel)series.Label).Position = FunnelSeriesLabelPosition.Center;
chart.Series.Add(series);

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/Funnel/FunnelItemControlProvider.cs#L57

csharp
}
((FunnelSeriesLabel)series.Label).Position = FunnelSeriesLabelPosition.Center;
return series;

winforms-dashboard-custom-items/VB/TutorialsCustomItems/CustomItems/FunnelItemControlProvider.vb#L62

vb
End If
CType(series.Label, FunnelSeriesLabel).Position = FunnelSeriesLabelPosition.Center
Return series

bi-dashboard-non-visual-custom-export/VB/DashboardExporterApp/ExportControlProviders/FunnelItemExportControlProvider.vb#L41

vb
End If
CType(series.Label, FunnelSeriesLabel).Position = FunnelSeriesLabelPosition.Center
chart.Series.Add(series)

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/Funnel/FunnelItemControlProvider.vb#L63

vb
End If
CType(series.Label, FunnelSeriesLabel).Position = FunnelSeriesLabelPosition.Center
Return series

See Also

Funnel Series View

Funnel Series View

FunnelSeriesLabel Class

FunnelSeriesLabel Members

DevExpress.XtraCharts Namespace