配置项如下
option = {
graphic: [{
type: 'group',
id: 'textGroup2',
left: 100,
top: 100,
draggable:true,
children: [
{
type: 'rect',
z: 100,
left: 'center',
top: 'center',
shape: {
width: 330,
height: 100
},
style: {
fill: '#fff',
stroke: '#999',
lineWidth: 2,
shadowBlur: 8,
shadowOffsetX: 3,
shadowOffsetY: 3,
shadowColor: 'rgba(0,0,0,0.3)'
}
},
{
type: 'text',
z: 100,
top: 'middle',
left: 'center',
style: {
text: [
'这个文本框的 bounding 为 "all"',
'表示定位时取整个 group 的',
'经过 transform 后的包围盒。'
].join('\n'),
font: '20px "STHeiti", sans-serif'
}
}
]
}]
}