Available in the Full Version

Funnel Chart - Using ASP.NET MVC

Bound to server side collection

Bound to remote data

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

This sample shows how to render an igFunnelChart in ASP.NET MVC. The example features two funnel charts. The first one is bound on the server side with a model object passed to the strongly typed Razor view. The second chart is bound to a remote data service.

Code View

Copy to Clipboard
@using Infragistics.Web.Mvc;
@model IQueryable<IgniteUI.SamplesBrowser.Controllers.BudgetData>

<!DOCTYPE html>

<html>
<head>
    <title></title>

    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.dv.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>

</head>
<body>
    <link href='@Url.Content("~/css/charts/chart-samples.css")' type="text/css" rel="stylesheet" />

    <script type="text/javascript">
        $(function () {
            $("#remoteData").igFunnelChart({
                width: "100%",
                height: "450px",
                leftMargin: 20,
                dataSourceUrl: "@Url.Action("getBudget")",
                valueMemberPath: "Budget",
                innerLabelMemberPath: "Budget",
                innerLabelVisibility: "visible"
            });
        });
    </script>

    <div class="sampleContent">
        <div class="chartContainer">
            <h4>Bound to server side collection</h4>
            @(Html.Infragistics().FunnelChart<IgniteUI.SamplesBrowser.Controllers.BudgetData>(Model)
                .ID("funnel")
                .Width("100%")
                .Height("450px")
                .ValueMemberPath("Budget")
                .InnerLabelMemberPath("Budget")
                .OuterLabelMemberPath("Department")
                .InnerLabelVisibility(Visibility.Visible)
                .OuterLabelVisibility(Visibility.Visible)
                .DataBind()
                .Render()
            )
        </div>
        <div class="chartContainer">
            <h4>Bound to remote data</h4>
            <div id="remoteData"></div>
        </div>
    </div>
</body>
</html>