Search results

Funnel Chart

To render a funnel series, use the series type as Funnel.

tagHelper
default.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

Size

The size of the funnel chart can be customized by using the width and height properties.

tagHelper
size.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel" width="60%" height="80%">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

Neck Size

The funnel’s neck size can be customized by using the neckWidth and neckHeight properties.

tagHelper
neck-size.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel" neckWidth="15%" neckHeight="18%">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

Gap Between the Segments

Funnel chart provides options to customize the space between the segments by using the gapRatio property of the series. It ranges from 0 to 1.

tagHelper
gap.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel" gapRatio="0.08">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

Explode

Points can be exploded on mouse click by setting the explode property to true. You can also explode the point on load using explodeIndex. Explode distance can be set by using explodeOffset property.

tagHelper
explode.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel" explodeIndex="3" explode="true" explodeOffset="10%">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

Customization

Individual points can be customized using the pointRender event.

tagHelper
custom.cs
@section ControlsSection{
      <ejs-accumulationchart id="container" title="Mobile Browser Statistics" pointRender="pointRender">
            <e-accumulationchart-legendsettings visible="false">
            </e-accumulationchart-legendsettings>
            <e-accumulation-series-collection>
                <e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Browser"
                type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel">
                </e-accumulation-series>
            </e-accumulation-series-collection>
        </ejs-accumulationchart>
 }
 <script>
            var pointRender = function (args) {
                if ((args.point.x).indexOf('iPhone') > -1) {
                    args.fill = '#f4bc42';
                     }
                       else {
                     args.fill = '#597cf9';
                     }
            };
</script>
public ActionResult Index()
        {
            List<FunnelChartData> chartData = new List<FunnelChartData>
            {

                new FunnelChartData { xValue = "Chrome", yValue = 37 },
                new FunnelChartData { xValue = "UC Browser", yValue = 17 },
                new FunnelChartData { xValue = "iPhone", yValue = 19 },
                new FunnelChartData { xValue = "Others", yValue = 4  },
                new FunnelChartData { xValue = "Opera", yValue = 11 },
                new FunnelChartData { xValue = "Android", yValue = 12 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class FunnelChartData
        {
            public string xValue;
            public double yValue;
        }

See Also