antvis / G2

📊 The concise and progressive visualization grammar.

Home Page:https://g2.antv.antgroup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何能调节shape的层级 使其不遮挡pieLabel

pocketChao opened this issue · comments

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

项目需要

What does the proposed API look like?

chart.pieLabel({
anchorOffset: -5, // 锚点偏移量 (为负数锚点直接插入环形图中)
inflectionOffset: 10, // 拐点偏移量
sidePadding: 10, // 文本距离画布左右两边的距离。
adjustOffset: 10,
lineStyle: {
// stroke: '#888', // 线条颜色 默认相同于饼颜色
lineWidth: 1, // 线条宽度
lineDash: [2, 1] // 虚线样式
},
label1: function label1(data) {
console.log(data);
return {
text: ${that.$translation('g_xmxqy_nr_tp_xx', '选项')}${data.sequence},
fill: '#888888',
textAlign: 'start'
};
}
});
截屏2024-07-15 16 06 18
截屏2024-07-15 16 06 55

    ....
    chart.render();
    const coord = chart.get('coord');
    chart.get('canvas').addShape('sector', {
      attrs: {
        x: coord.center.x,
        y: coord.center.y,
        r: coord.circleRadius * 1.1,
        r0: coord.circleRadius,
        fill: shapeColor,

      }
    });
    chart.get('canvas').draw();