Back to Devexpress

Funnel3DSeriesView.HoleRadiusPercent Property

corelibraries-devexpress-dot-xtracharts-dot-funnel3dseriesview-21cac39d.md

latest6.1 KB
Original Source

Funnel3DSeriesView.HoleRadiusPercent Property

Gets or sets the radius of the inner circle in the Funnel 3D series.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Layout)]
public int HoleRadiusPercent { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Layout)>
Public Property HoleRadiusPercent As Integer

Property Value

TypeDescription
Int32

An integer, representing the percentage of the inner radius to the outer radius of a 3D funnel. Should be greater than or equal to 0 and less than or equal to 100.

|

Example

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

private void Form1_Load(object sender, EventArgs e) {
    // Create an empty chart.
    ChartControl funnelChart3D = new ChartControl();

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

    // Populate the series with points.
    series1.Points.Add(new SeriesPoint("A", 28.5));
    series1.Points.Add(new SeriesPoint("B", 19.6));
    series1.Points.Add(new SeriesPoint("C", 17.1));
    series1.Points.Add(new SeriesPoint("D", 12.5));
    series1.Points.Add(new SeriesPoint("E", 9.6));

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

    // Display a title for the series, 
    // and adjust another view-type-specific options of the series.
    Funnel3DSeriesView funnelView = (Funnel3DSeriesView)series1.View;
    funnelView.Titles.Add(new SeriesTitle());
    funnelView.Titles[0].Text = series1.Name;
    funnelView.HeightToWidthRatio = 1;
    funnelView.HoleRadiusPercent = 70;
    funnelView.PointDistance = 5;

    // Adjust the value numeric options of the series.
    series1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
    series1.PointOptions.ValueNumericOptions.Precision = 1;

    // Access the view-type-specific series options.
    ((FunnelPointOptions)series1.PointOptions).PercentOptions.ValueAsPercent = true;

    // Position the series labels.
    ((Funnel3DSeriesLabel)series1.Label).Position = 
        FunnelSeriesLabelPosition.LeftColumn;

    // Access the diagram's options.
    ((FunnelDiagram3D)funnelChart3D.Diagram).RuntimeRotation = true;
    ((FunnelDiagram3D)funnelChart3D.Diagram).RotationType = 
        RotationType.UseMouseStandard;

    // Hide the chart's legend.
    funnelChart3D.Legend.Visible = false;

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

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _ 
Handles MyBase.Load
    ' Create an empty chart.
    Dim funnelChart3D As New ChartControl()

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

    ' Populate the series with points.
    series1.Points.Add(New SeriesPoint("A", 28.5))
    series1.Points.Add(New SeriesPoint("B", 19.6))
    series1.Points.Add(New SeriesPoint("C", 17.1))
    series1.Points.Add(New SeriesPoint("D", 12.5))
    series1.Points.Add(New SeriesPoint("E", 9.6))

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

    ' Display a title for the series, 
    ' and adjust another view-type-specific options of the series.
    Dim funnelView As Funnel3DSeriesView = CType(series1.View, Funnel3DSeriesView)
    funnelView.Titles.Add(New SeriesTitle())
    funnelView.Titles(0).Text = series1.Name
    funnelView.HeightToWidthRatio = 1
    funnelView.HoleRadiusPercent = 70
    funnelView.PointDistance = 5

    ' Adjust the value numeric options of the series.
    series1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent
    series1.PointOptions.ValueNumericOptions.Precision = 1

    ' Access the view-type-specific series options.
    CType(series1.PointOptions, FunnelPointOptions).PercentOptions.ValueAsPercent = True

    ' Position the series labels.
    CType(series1.Label, Funnel3DSeriesLabel).Position = _ 
        FunnelSeriesLabelPosition.LeftColumn

    ' Access the diagram's options.
    CType(funnelChart3D.Diagram, FunnelDiagram3D).RuntimeRotation = True
    CType(funnelChart3D.Diagram, FunnelDiagram3D).RotationType = _ 
        RotationType.UseMouseStandard

    ' Hide the chart's legend.
    funnelChart3D.Legend.Visible = False

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

See Also

Funnel Series View

Funnel3DSeriesView Class

Funnel3DSeriesView Members

DevExpress.XtraCharts Namespace