Skip to content

[Bug]: 仪表盘默认效果是靠上的,通过margin调整位置,坐标轴如果使用inner,坐标轴位置会错乱 #7300

@xiaoke-1

Description

@xiaoke-1

Describe the bug / 问题描述

坐标轴本应该在圆弧内侧,现在位置完全错乱了
Image

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

官网示例增加margin和position可直接复现

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart
.attr('marginLeft', 0)
      .attr('marginRight', 0)
      .attr('marginTop', 60)
      .attr('marginBottom', 20)
  .gauge()
  .data({
    value: {
      target: 120,
      total: 400,
      name: 'score',
    },
  })
  .legend(false)
  .axis('y',{
    position:'inner',
  });

chart.render();

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: minor bug or important featurebug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions