@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.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2024.1/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.1/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.dv.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.1/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>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace IgniteUI.SamplesBrowser.Controllers
{
public class FunnelChartController : Controller
{
//
// GET: /FunnelChart/
[ActionName("server-binding")]
public ActionResult BindCollection()
{
var data = new List<BudgetData>()
{
new BudgetData { Budget = 30, Department = "Administration" },
new BudgetData { Budget = 50, Department = "Sales" },
new BudgetData { Budget = 60, Department = "IT" },
new BudgetData { Budget = 50, Department = "Marketing" },
new BudgetData { Budget = 100, Department = "Development" },
new BudgetData { Budget = 20, Department = "Support" }
};
return View("server-binding", data.AsQueryable());
}
[ActionName("getBudget")]
public JsonResult GetBudget()
{
var data = new List<BudgetData>()
{
new BudgetData { Budget = 30, Department = "Administration" },
new BudgetData { Budget = 50, Department = "Sales" },
new BudgetData { Budget = 60, Department = "IT" },
new BudgetData { Budget = 50, Department = "Marketing" },
new BudgetData { Budget = 100, Department = "Development" },
new BudgetData { Budget = 20, Department = "Support" }
};
return new JsonResult { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
}
public class BudgetData
{
public decimal Budget { get; set; }
public string Department { get; set; }
}
}