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

fix(tooltip): show falsy item by default #4907

Merged
merged 1 commit into from
Apr 23, 2023
Merged

fix(tooltip): show falsy item by default #4907

merged 1 commit into from
Apr 23, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Apr 23, 2023

fix #4891 ,目前 tooltip items 不会自动过滤 falsy 的值:

  • null
  • undefined
  • NaN
  • 0

如果希望过滤这些值,可以通过自定义 filter 函数:

chart.interaction('tooltip', {
  filter: (d) =>
    d.value !== null && d.value !== undefined && !Number.isNaN(d.value),
});

@hustcc hustcc merged commit 29ed50c into v5 Apr 23, 2023
@hustcc hustcc deleted the fix/toolitp-falsy branch April 23, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

【v5】Tooltip 无法展示 falsy 值
3 participants