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

Tooltip crosshairs 设置问题 #3436

Closed
1 task done
visiky opened this issue May 24, 2021 · 5 comments
Closed
1 task done

Tooltip crosshairs 设置问题 #3436

visiky opened this issue May 24, 2021 · 5 comments
Labels

Comments

@visiky
Copy link
Member

visiky commented May 24, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://g2-v4.antv.vision/en/examples/line/basic#base

Steps to reproduce

chart.tooltip({
  showCrosshairs: true, // 展示 Tooltip 辅助线
  shared: true,
  crosshairs: {
    type: 'xy',
    follow: true,
    text: (type, defaultContent, items) => {
      const tooltipCrosshairsText = { position: type === 'y' ? 'start' : 'end' };
      if (type === 'x') {
        const item = items[0];
        tooltipCrosshairsText['content'] = item ? item.title : defaultContent;
      } else {
        tooltipCrosshairsText['content'] = `${defaultContent.toFixed(2)}`;
      }
      return tooltipCrosshairsText;
    },
    textBackground: {
      padding: [4, 8],
      style: {}
    }
  }
});
Environment Info
g2 4.1.16
System -
Browser -

image

@hustcc
Copy link
Member

hustcc commented Oct 8, 2021

什么问题?@visiky

@dadazhouRenee
Copy link

多组柱状图时 辅助线可以居中吗

@Phinome
Copy link

Phinome commented Jun 16, 2022

遇到同样的问题,这里 Y 轴的显示数值被遮挡了,另外还有个问题,能否设置 crosshairs 的辅助线 z-index ,让其始终置于顶层

@visiky
Copy link
Member Author

visiky commented Jun 23, 2022

什么问题?@visiky

y 轴上有一个 2.55, 但实际数值并不是

@visiky visiky added the Tooltip label Jun 23, 2022
@hustcc
Copy link
Member

hustcc commented Dec 7, 2022

image

是不是已经修复了?

什么问题?@visiky

y 轴上有一个 2.55, 但实际数值并不是

@hustcc hustcc closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants