JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://jp.igniteui.com/js/modernizr.min.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.dv.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/i18n/infragistics-ja.js"></script>
<div id="chart"></div>
CSS
#chart {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
JavaScript
$(function () {
//Sample XML Data
var xmlDoc = '<Countries>' +
'<Country Name="中国" Population="1333" />' +
'<Country Name="インド" Population="1140" />' +
'<Country Name="米国" Population="304" />' +
'<Country Name="インドネシア" Population="228" />' +
'<Country Name="ブラジル" Population="192" />' +
'</Countries>';
//Binding to XML requires a schema to define data fields
var xmlSchema = new $.ig.DataSchema("xml",
{
//searchField serves as the base node(s) for the XPaths
searchField: "//Country",
fields: [
{ name: "Name", xpath: "./@Name" },
{ name: "Population", xpath: "./@Population", type: "number" },
]
}
);
//This creates an Infragistics datasource from the XML
//and the Schema which can be consumed by the grid.
var ds = new $.ig.DataSource({
type: "xml",
dataSource: xmlDoc,
schema: xmlSchema
});
$("#chart").igPieChart({
width: "435px",
height: "435px",
dataSource: ds,
valueMemberPath: "Population",
labelMemberPath: "Name",
labelsPosition: "bestFit"
});
});