Sunburst - Simple data
No data values - equal distribution
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/sunburst.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 310px;
max-width: 800px;
margin: 0 auto
}
JavaScript
var colors = Highcharts.getOptions().colors;
// Splice in transparent for the center circle
Highcharts.getOptions().colors.splice(0, 0, 'transparent');
Highcharts.chart('container', {
chart: {
height: '100%',
type: 'pie'
},
title: {
text: 'World population 2017'
},
subtitle: {
text: 'Source <href="https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)">Wikipedia</a>'
},
plotOptions: {
sunburst: {}
},
series: [{
type: "sunburst",
data: [{
'id': '0.0',
'parent': '',
'name': 'The World'
}, {
id: '1.0',
parent: '0.0',
name: 'Consumer',
color: colors[1]
}, {
parent: '1.0',
name: 'Furniture',
value: 1
}, {
parent: '1.0',
name: 'Office Supplies',
value: 1
}, {
parent: '1.0',
name: 'Technology',
value: 1
}, {
id: '2.0',
name: 'Corporate',
parent: '0.0',
color: colors[2]
}, {
parent: '2.0',
name: 'Furniture',
value: 1
}, {
parent: '2.0',
name: 'Office Supplies',
value: 1
}, {
parent: '2.0',
name: 'Technology',
value: 1
}, {
id: '3.0',
name: 'Home office',
parent: '0.0',
color: colors[3]
}, {
parent: '3.0',
name: 'Furniture',
value: 1
}, {
parent: '3.0',
name: 'Office Supplies',
value: 1
}, {
parent: '3.0',
name: 'Technology',
value: 1
}, {
id: '4.0',
name: 'Small Business',
parent: '0.0',
color: colors[4]
}, {
parent: '4.0',
name: 'Office Supplies'
}, {
parent: '4.0',
name: 'Technology'
}],
allowDrillToNode: true,
cursor: 'pointer',
dataLabels: {
/**
* A custom formatter that returns the name only if the inner arc
* is longer than a certain pixel size, so the shape has place for
* the label.
*/
...