We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我希望可以自定义tooltip中的name字段。我在这里找到这样的代码。
({ tooltip: { items: [ (d, index, data, column) => ({ color: d.sold > 150 ? 'red' : 'blue', // 指定 item 的颜色 name: index === 0 ? d.genre : `${d.genre} ${data[i].genre}`, // 指定 item 的名字 value: column.y.value[i], // 使用 y 通道的值 }), ], }, });
但实际上这里并不是直接自定义name属性,最终是把name属性当作字段值再次替换了一次,我期望的效果是直接使用我指定的name值。
可以直接在官网的demo中复现这个问题。https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series
https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series
https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series 可以直接修改这里的name字段,会发现并不会生效。
我不清楚目前的行为是否符合官方的预期,我的预期是直接使用我指定的name字符串。
No response
The text was updated successfully, but these errors were encountered:
对于这线图的 tooltip,需要添加:
chart.interaction('tooltip', {groupName:false})
Sorry, something went wrong.
No branches or pull requests
问题描述
我希望可以自定义tooltip中的name字段。我在这里找到这样的代码。
但实际上这里并不是直接自定义name属性,最终是把name属性当作字段值再次替换了一次,我期望的效果是直接使用我指定的name值。
可以直接在官网的demo中复现这个问题。https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series
重现链接
https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series
重现步骤
https://g2.antv.antgroup.com/zh/examples/component/tooltip/#tooltip-series
可以直接修改这里的name字段,会发现并不会生效。
预期行为
我不清楚目前的行为是否符合官方的预期,我的预期是直接使用我指定的name字符串。
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: