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
没法截图,手动交互一下,比较明显
.style('cursor', 'pointer') 手形在,hover 图例区后,再 hover 在柱子上,就不出手形了
.style('cursor', 'pointer')
图例不影响 style cursor 效果
官方代码修改
import { Chart } from '@antv/g2'; const chart = new Chart({ container: 'container', autoFit: true, }); chart .interval() .data([ { name: 'MODIFY', value: 138, washaway: 0.21014492753623193 }, { name: 'PRERELEASE', value: 109, washaway: 0.5596330275229358 }, { name: 'RELEASING', value: 48, washaway: 0 }, ]) .encode('x', 'name') .encode('y', 'value') .encode('color', 'name') .encode('size', 80) .style('radiusTopLeft', 10) .style('radiusTopRight', 20) .style('radiusBottomRight', 30) .style('radiusBottomLeft', 40) .style('cursor', 'pointer'); chart.render();
The text was updated successfully, but these errors were encountered:
这个原因应该是 cursor 是一个 canvas 的全局属性,移除图例会设置为默认的 cusor,更好的做法是还原之前的 cusor。
Sorry, something went wrong.
感兴趣来修复一下这个 bug 吗?大概就是修改一下 src/interaction/utils.ts 里面的 setCursor 和 restoreCursor。一种思路如下:
src/interaction/utils.ts
setCursor
restoreCursor
function useCursor() { // ... const originCursor = dom.style.cursor; // ... const setCursor = () => {}; const restoreCursor = () => {dom.style.cursor = originCursor}; return [setCursor, restoreCursor]; }
感兴趣来修复一下这个 bug 吗?大概就是修改一下 src/interaction/utils.ts 里面的 setCursor 和 restoreCursor。一种思路如下: function useCursor() { // ... const originCursor = dom.style.cursor; // ... const setCursor = () => {}; const restoreCursor = () => {dom.style.cursor = originCursor}; return [setCursor, restoreCursor]; }
这两天我试试?:sweat_smile:
Successfully merging a pull request may close this issue.
问题描述
没法截图,手动交互一下,比较明显
.style('cursor', 'pointer')
手形在,hover 图例区后,再 hover 在柱子上,就不出手形了期望结果
图例不影响 style cursor 效果
如何重现
官方代码修改
额外信息
The text was updated successfully, but these errors were encountered: