The ASP.NET MVC Pie Chart is a circular graphic with multiple slices, which is used for comparing the proportional values of different categories.
Legends are used to show information about each point, to know about its contribution towards the total sum. You can collapse the point using legend click.
Customize the radius of the pie to change the look and functionality of the chart.
Customize the start and end angles of the chart to achieve a semi-pie.
Data labels display information about data points. Add a template to display data labels with HTML elements such as images, DIV, and spans for more informative data labels. You can rotate a data label by its given angle.
Arranges data labels smartly to avoid overlapping when the data point values fall in close range.
Group the points in a pie chart based on specific conditions. The grouped slices can be split into individual points by clicking the slice.
Users click a specific bar or segment of a chart to drill-down to a more detailed report.
Customize the radius of individual slice using built-in APIs.
The ASP.NET MVC Pie Chart’s center moves relative to the plot area. Labels may jump around when there are many slices in the plot area and the center can be set in a more spacious area.
Place a label at the center of the pie chart. Also, when the mouse pointer hovers over a pie slice, the relevant data is displayed at the center of the pie chart.
Customize the look and feel of the pie using built-in APIs.
Easily get started with ASP.NET MVC Pie Chart by using a few lines of CSHTML and C# code, as demonstrated below. Also explore our ASP.NET MVC Pie Chart Example that shows how to render and configure the chart.
@(Html.EJS().AccumulationChart("container").Series(series =>
{
series.DataSource(ViewBag.dataSource).XName("xValue").YName("yValue")
.Type(Syncfusion.EJ2.Charts.AccumulationType.Pie).Add();
}).Render()
);
public class HomeController : Controller
{
public ActionResult Index()
{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { xValue = "Chrome", yValue = 37 },
new PieChartData { xValue = "UC Browser", yValue = 17 },
new PieChartData { xValue = "iPhone", yValue = 19 },
new PieChartData { xValue = "Others", yValue = 4 },
new PieChartData { xValue = "Opera", yValue = 11 },
new PieChartData { xValue = "Android", yValue = 12 },
};
ViewBag.dataSource = chartData;
return View();
}
}
public class PieChartData
{
public string xValue;
public double yValue;
}
Learn the available options to customize the ASP.NET MVC Pie chart.
Explore the ASP.NET MVC Pie chart APIs.