FunnelSeriesView.HeightToWidthRatioAuto Property

Gets or sets a value which indicates whether the height-to-width ratio of a Funnel series should be auto-calculated.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Layout)]
public bool HeightToWidthRatioAuto { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Layout)>
Public Property HeightToWidthRatioAuto As Boolean

Property Value

Type Description
Boolean

true if the height-to-width ratio should be auto-calculated; otherwise, false.

Remarks

Use the HeightToWidthRatioAuto property, to toggle between automatic and manual height-to-width ratio definition for Funnel series.

If the HeightToWidthRatioAuto property is set to false, the FunnelSeriesViewBase.HeightToWidthRatio property becomes available, which allows you to manually define the desired ratio.

The following images demonstrate the HeightToWidthRatioAuto property in action.

HeightToWidthRatioAuto = true

HeightToWidthRatioAuto = false

HeightToWidthRatio = 1

PointDistance_0

HeightToWidthRatio_1

Examples

The following example demonstrates how to create a ChartControl with a series of the FunnelSeriesView type, and add this chart to a form at runtime. Before proceeding with this example, create a Windows Forms Application in Visual Studio, and add all required assemblies to the References list of your project.

Then, add the following code to the Form.Load event handler.

using DevExpress.XtraCharts;
// ...

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.
    FunnelPointOptions myPointOptions = (FunnelPointOptions)series1.PointOptions;

    myPointOptions.PointView = PointView.ArgumentAndValues;
    myPointOptions.PercentOptions.ValueAsPercent = true;
    myPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
    myPointOptions.ValueNumericOptions.Precision = 0;

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

    // Hide the legend (if necessary).
    funnelChart.Legend.Visible = false;

    // Add the chart to the form.
    funnelChart.Dock = DockStyle.Fill;
    this.Controls.Add(funnelChart);
}
See Also