Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

仪表盘 中间文字 显示不需要的 toopTip #6382

Closed
saleemshenlin opened this issue Jul 24, 2024 · 2 comments
Closed

仪表盘 中间文字 显示不需要的 toopTip #6382

saleemshenlin opened this issue Jul 24, 2024 · 2 comments

Comments

@saleemshenlin
Copy link

问题描述

如题。
image

重现链接

https://g2.antv.antgroup.com/zh/examples/general/gauge/#gauge-default

重现步骤

官网的例子

预期行为

这里应该隐藏

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

建议

  1. 修改默认对象

    G2/src/mark/gauge.ts

    Lines 115 to 126 in 1aabab7

    const DEFAULT_TEXT_OPTIONS = {
    type: 'text',
    style: {
    x: '50%',
    y: '60%',
    textAlign: 'center',
    textBaseline: 'middle',
    fontSize: 20,
    fontWeight: 800,
    fill: '#888',
    },
    };

    在这个对象中加入tooltip 的配置
  2. 在配置的时候可以外部控制

    G2/src/mark/gauge.ts

    Lines 242 to 249 in 1aabab7

    deepMix({}, DEFAULT_TEXT_OPTIONS, {
    style: {
    text: getTextContent(textStyle, { target, total }),
    ...textStyle,
    },
    animate:
    typeof animate === 'object' ? subObject(animate, 'text') : animate,
    }),

    在这个对象增加
    typescript ...resOptions,
    类似

    G2/src/mark/gauge.ts

    Lines 233 to 241 in 1aabab7

    deepMix({}, DEFAULT_OPTIONS, DEFAULT_INDICATOR_OPTIONS, {
    type: 'point',
    data: targetData,
    scale: newScale,
    style: indicatorStyle,
    animate:
    typeof animate === 'object' ? subObject(animate, 'indicator') : animate,
    ...resOptions,
    }),
@hustcc
Copy link
Member

hustcc commented Aug 27, 2024

@saleemshenlin 代码都标记出来了,直接来来一个 RP 把代码提交上来吧。

@hustcc
Copy link
Member

hustcc commented Dec 4, 2024

@BQXBQX 已跟进 PR。

@hustcc hustcc closed this as completed Dec 5, 2024
@github-project-automation github-project-automation bot moved this from 已认领 to Done in AntV OSCP 开发者贡献需求 Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants