如果我的数据是9个的时候 他可以正常排序(从上到下,从左到右正常排序)。可是当我的数据是12个的时候他就失了智了 。第七个排在了第一个位置
配置项如下
var rawData = [{
value: 90,
children: [{
name: '1',
value: 10,
itemStyle: {
normal: {
color: '#d34c0c'
}
}
}, {
name: '2',
value: 10,
itemStyle: {
normal: {
color: '#d35c1c'
}
}
}, {
name: '3',
value: 10,
itemStyle: {
normal: {
color: '#d36c2c'
}
}
}, {
name: '4',
value: 10,
itemStyle: {
normal: {
color: '#d37c3c'
}
}
}, {
name: '5',
value: 10,
itemStyle: {
normal: {
color: '#d38c4c'
}
}
}, {
name: '6',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '7',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '8',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '9',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '10',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '11',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}, {
name: '12',
value: 10,
itemStyle: {
normal: {
color: '#d39c5c'
}
}
}]
}];
option = {
tooltip: {
trigger: 'item',
formatter: "{b}" //显示tooltip时,只显示name
},
toolbox: {
show: false,
feature: {
mark: {
show: true
},
dataView: {
show: true,
readOnly: false
},
restore: {
show: true
},
saveAsImage: {
show: true
}
}
},
calculable: false,
series: [{
name: '矩形图',
type: 'treemap',
top: 0,
left: 0,
width: 600,
height: 400,
squareRatio: 1.1,
itemStyle: {
normal: {
label: {
show: true,
//formatter: "{b}",
fontSize: 15
},
borderWidth: 1
},
emphasis: {
label: {
show: true
}
}
},
label: {
normal: {
textStyle: {
fontSize: 15,
//formatter: "{b}"
}
}
},
breadcrumb: {//关闭面包屑路径
show: false
},
roam: false,//关闭平移拖动
nodeClick: false,//关闭节点点击
silent: false,//关闭鼠标事件
data: rawData
}]
};