<!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">
選択モード: 
<select id="selectionModeCombo">
<option value="single" selected="selected">単一</option>
<option value="multiple">複数</option>
</select>
</div>
<div id="chart"></div>
<script>
$(function () {
var data = [
{ "CountryName": "中国", "Pop1990": 1141, "Pop2008": 1333, "Pop2025": 1458 },
{ "CountryName": "インド", "Pop1990": 849, "Pop2008": 1140, "Pop2025": 1398 },
{ "CountryName": "米国", "Pop1990": 250, "Pop2008": 304, "Pop2025": 352 },
{ "CountryName": "インドネシア", "Pop1990": 178, "Pop2008": 228, "Pop2025": 273 },
{ "CountryName": "ブラジル", "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>