G2 icon indicating copy to clipboard operation
G2 copied to clipboard

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

Open pocketChao opened this issue 7 months ago • 0 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();

pocketChao avatar Jul 15 '24 08:07 pocketChao