<!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>
<style>
.selectionOptions
{
margin-bottom: 10px;
}
</style>
</head>
<body>
<style type="text/css">
#chart {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
</style>
<div class="selectionOptions">
Selection mode: 
<select id="selectionModeCombo">
<option value="single" selected="selected">Single</option>
<option value="multiple">Multiple</option>
</select>
</div>
<div id="chart"></div>
<script>
$(function () {
var data = [
{ "CountryName": "China", "Pop1990": 1141, "Pop2008": 1333, "Pop2025": 1458 },
{ "CountryName": "India", "Pop1990": 849, "Pop2008": 1140, "Pop2025": 1398 },
{ "CountryName": "United States", "Pop1990": 250, "Pop2008": 304, "Pop2025": 352 },
{ "CountryName": "Indonesia", "Pop1990": 178, "Pop2008": 228, "Pop2025": 273 },
{ "CountryName": "Brazil", "Pop1990": 150, "Pop2008": 192, "Pop2025": 223 }
];
$("#chart").igPieChart({
width: "435px",
height: "435px",
dataSource: data, //JSON data defined above
dataValue: "Pop2008",
dataLabel: "CountryName",
labelsPosition: "bestFit",
selectedStyle: { stroke: "rgba(0, 0, 0, 0.3)", strokeThickness: "5" },
selectedItemChanged: function (e, args) {
console.log("selected item is: ");
console.log($("#chart").igPieChart("option", "selectedItem"));
}
});
$("#selectionModeCombo").change(function (e) {
var selectionMode = $(this).val();
if (selectionMode == "single") {
$("#chart").igPieChart("option", "selectionMode", "single");
}
if (selectionMode == "multiple") {
$("#chart").igPieChart("option", "selectionMode", "multiple");
}
if (selectionMode == "manual") {
$("#chart").igPieChart("option", "selectionMode", "manual");
}
});
});
</script>
</body>
</html>