Treemap Demo
author(s):
Jon Arild Nygård
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/treemap.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 300px;
max-width: 600px;
margin: 0 auto;
}
JavaScript
$(function () {
$('#container').highcharts({
series: [{
type: "treemap",
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
layoutAlgorithm: 'sliceAndDice',
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top',
style: {
fontSize: '15px',
fontWeight: 'bold'
}
}
}],
data: [{
id: 'A',
name: 'Visualizações',
color: "#EC2500"
}, {
id: 'B',
name: 'Relatório',
color: "#ECE100"
}, {
id: 'O',
name: 'Anexos',
color: '#EC9800'
},
{
name: 'Gráfico',
parent: 'A',
value: 5
}, {
name: 'Nuvem Palavras',
parent: 'A',
value: 3
}, {
name: 'treemap',
parent: 'A',
value: 1
}, {
name: 'Anexos',
parent: 'B',
value: 50
}, {
name: 'Visualizações',
parent: 'B',
value: 10
},
{
name: 'Projeto',
parent: 'O',
value: 2
}, {
name: 'Experimentos',
parent: 'O',
value: 4
}, {
name: 'Glossário de termos',
parent: 'O',
value: 7
},
{
name: 'Processo produção',
parent: 'O',
value: 1
},
{
...