anychart.onDocumentReady(function () {
{name: "Andorra", value: 57600000, custom_field: "info 1", children: [
{name: "Machines", value: 22400000, custom_field: "info 2", children: [
{name: "Integrated Circuits", value: 12200000, custom_field: "info 7"},
{name: "Blank Audio Media", value: 2500000, custom_field: "info 8"},
{name: "Computers", value: 1100000, custom_field: "info 9"}
{name: "Instruments", value: 9750000, custom_field: "info 3", children: [
{name: "Orthopedic Appliances", value: 8900000, custom_field: "info 10"}
{name: "Chemical Products", value: 4740000, custom_field: "info 4", children: [
{name: "Essential Oils", value: 3690000, custom_field: "info 11"},
{name: "Beauty Products", value: 423000, custom_field: "info 12"}
{name: "Mineral Products", value: 4540000, custom_field: "info 5", children: [
{name: "Coal Briquettes", value: 4280000, custom_field: "info 13"}
{name: "Transportation", value: 4060000, custom_field: "info 6", children: [
{name: "Cars", value: 2870000, custom_field: "info 14"},
{name: "Vehicle Parts", value: 640000, custom_field: "info 15"}
var chart = anychart.sunburst(data, "as-tree");
chart.calculationMode("parent-dependent");
chart.labels().useHtml(true);
chart.labels().format(function() {
var sales = Math.round(this.value/100000)/10;
return "<span style='font-weight:bold'>" + this.name +
"</span><br/>" + sales + " mln";
chart.leaves().labels().format(function() {
var sales = Math.round(this.value/100000)/10;
chart.tooltip().format(function() {
var sales = Math.round(this.value/100000)/10;
return this.name + "\n\nsales: " + sales +
" mln\n" + this.getData("custom_field");
chart.title().useHtml(true);
chart.title("Sunburst: Labels and Tooltips (Formatting Functions)<br><br>" +
"<span style='font-size:12; font-style:italic'>" +
chart.container("container");