自定义类型返回group元素时,对group经行定位,定位失效,这是问什么,求解释!!!
配置项如下
var data = [
[36, 36, 'yiyiyi'],
[72, 160, 'ererer']
]
var renderItem = function(param, api) {
var children = [];
children.push({
type: 'text',
style: {
text: api.value(2),
// x: api.value(0),
// y: api.value(1),
font: '12px STHeiti, sans-serif',
fill: 'black',
textAlign: 'center'
}
});
return {
type: 'group',
left: api.value(0),
top: api.value(1),
children: children
}
}
option = {
grid: {
top: 0,
left: 0
},
xAxis: {
type: 'value',
show: false
},
yAxis: {
type: 'value',
show: false,
inverse: true
},
series: [{
type: 'custom',
data: data,
renderItem: renderItem
}]
};