Available in the Full Version

Pie Chart - Using ASP.NET MVC

This is a basic example showing the pie chart created with the ASP.NET MVC helper.
Administration
Sales
Marketing
Development
Customer Support
IT

This sample is designed for a larger screen size.

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

Code View

Copy to Clipboard
@using Infragistics.Web.Mvc
@using IgniteUI.SamplesBrowser.Models

@model IgniteUI.SamplesBrowser.Models.Financial.FinancialDataCollection

<!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>

    <style type="text/css">
        .ui-slider-handle.ui-state-focus {
            outline: none 0;
        }

        #chart {
            position: relative;
            float: left;
            margin-right: 10px;
            margin-bottom: 10px;
        }

        #legend {
            position: relative;
            float: left;
        }

        .tooltip {
            font-weight: bold;
        }
    </style>

    @(Html.Infragistics().PieChart(Model.AsQueryable())
               .ID("chart")
               .Width("435px")
               .Height("435px")
               .ValueMemberPath(data => data.Budget)
               .LabelMemberPath(data => data.Label)
               .ExplodedSlices("0 1")
               .RadiusFactor(.8)
               .Legend(leg => leg.ID("legend").LegendType(LegendType.Item))
               .AllowSliceExplosion(true)
               .ShowTooltip(true)
               .TooltipTemplate("<div class='tooltip'>${item.Label}</div><div>" + "Budget" + ": ${item.Budget}</div>")
               .DataBind()
               .Render()
        )



</body>
</html>