antvis/G2

[Bug]: Point标记在设置shape为triangleDown和hollowTriangleDown的时候显示形状不正确 #6693

interstellarmt posted onGitHub

Describe the bug / 问题描述

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

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

chart
  .point()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/basement_prod/6b4aa721-b039-49b9-99d8-540b3f87d339.json',
  })
  .encode('x', 'height')
  .encode('y', 'weight')
  .encode('color', 'gender')
  .encode('shape','triangleDown')

chart.render();

Image

No response

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

No response

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

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

legend中的符号是正确的,point下的显示不符合预期

posted by interstellarmt about 1 month ago

<img width="563" alt="Image" src="https://github.com/user-attachments/assets/4391d3a9-2680-4650-af2e-ed304ee761e5" />

<img width="558" alt="Image" src="https://github.com/user-attachments/assets/5c7c8ba3-a34e-4be3-a575-c71fd2d88266" />

问题在于 symbol 的命名格式,TriangleDown 使用了 triangle-down 但是 Symbols 中用了 triangleDown,统一一下即可

<img width="1322" alt="Image" src="https://github.com/user-attachments/assets/bf0dbb84-26c3-4327-b0ec-b1214f1a741c" />

posted by BQXBQX about 1 month ago

可以兼容下,都支持掉,antv util 中应该有这个字符串方法

posted by hustcc about 1 month ago

Fund this Issue

$0.00
Funded

Pull requests