antvis / antvis/F2

F2 如何自定义 Tooltip 的内容和样式

Open
#1,989 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

- **F2 Version**:
- **Platform**:
- **Mini Showcase(like screenshots)**:
- **CodeSandbox Link**:

我想自定义 f2 的 tooltip,翻了源码试了很久,发现这个 customText 是这样用的:
1. custom 默认是 false
2. customText 传进去 一个函数,return 图形标签

这个逻辑在文档,Props 注释中都没有提到,想问下这个用法我可以当做 feature 直接这样用吗?

![1231](https://github.com/user-attachments/assets/bb3b17ee-58a6-4ec2-bfef-d371a777bcbc)
![1231241](https://github.com/user-attachments/assets/de103613-ef6a-44dd-974d-6f92351eef32)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the tooltip source and the Props comments referenced in the issue, focusing on the custom and customText options. Clarify whether the current behavior is supported, then document how customText is passed and what it controls; completion should leave the tooltip customization behavior explicitly described in the documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.