Closed XD-DENG closed 8 years ago
The "drill down" feature is mainly handled by leafDepth
argument.
var option = {
tooltip : {
trigger: 'item',
formatter: "{b}: {c}"
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : false,
series : [
{
name:'Main Chart',
type:'treemap',
leafDepth: 2,
itemStyle: {
normal: {
label: {
show: true,
formatter: "{b}"
},
borderWidth: 1
},
emphasis: {
label: {
show: true
}
}
},
data:[
{
name: 'A',
value: 6,
children: [
{
name: 'A-1',
value: 6,
children:[
{
name: 'A-1-1',
value: 6
},
{
name: 'A-1-2',
value: 2
}
]
},
{
name: 'A-2',
value: 3
},
{
name: 'A-3',
value: 3
}
]
},
{
name: 'B',
value: 6,
children: [
{name : 'B-1',
value:10
},
{
name:"B-2",
value:2
}
]
},
{
name: 'C',
value: 4
},
{
name: 'D',
value: 1
},
{
name: 'E',
value: 1
},
{
name: 'F',
value: 1
},
{
name: 'G',
value: 1
}
]
}
]
};
addressed with commit 73f41fb0a66236b235c7dd74f1dc92c3598233e4
furtherly addressed with commit 77d90049b616a50ed5ee785ce11fcd8580edf6b0
NORMAL