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

饼图交互 中心文本无法走 customHtml 自定义中心文本的问题 #2375

Closed
ai-qing-hai opened this issue Mar 1, 2021 · 0 comments · Fixed by #2413
Closed

饼图交互 中心文本无法走 customHtml 自定义中心文本的问题 #2375

ai-qing-hai opened this issue Mar 1, 2021 · 0 comments · Fixed by #2413
Assignees

Comments

@ai-qing-hai
Copy link
Contributor

ai-qing-hai commented Mar 1, 2021

  • G2Plot Version: 2.3.2
    statistic: {
    content: {
    offsetY: 4,
    style: {
    fontSize: '32px',
    },
    customHtml: (container, view, datum, data) => {
    const text = datum ? ¥ ${datum.value} : ¥ ${data.reduce((r, d) => r + d.value, 0)};
    return text;
    },
    },
    },
    // 添加 中心统计文本 交互
    interactions: [{ type: 'element-selected' }, { type: 'element-active' }, { type: 'pie-statistic-active' }],
    饼图交互 中心文本无法走 customHtml 自定义中心文本的问题 @新茗
    饼图中心文本有 type: 'pie-statistic-active' 交互时 ,当鼠标移动,会显示鼠标当前所在位置的数据。而,显示的数据的样式时默认的样式,并没有通过statistic属性进行改变。 现在需要 对文本进行自动缩放大小处理需要经过statistic属性的计算。
hustcc pushed a commit that referenced this issue Mar 10, 2021
* fix(issue-2375): 中心文本交互,走 statistic 通道一样的逻辑,将额外信息传入交互中

fix: 修复饼图中心文本交互没有走 custom-html

* fix(issue-2375): 添加饼图中心文本csutomHtml的单测

* test: 移除测试中的所有 settimeout

* fix(gauge): 修复仪表盘单测

* fix(pie): 修复饼图单测, statistic 配置默认处理
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants