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

feat: add tooltip data to tooltip event callback #6529

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/interaction/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ export function seriesTooltip(
...event,
nativeEvent: true,
data: {
...tooltipData,
data: { x: invert(scale.x, transformedX, true) },
},
});
Expand Down Expand Up @@ -1095,6 +1096,7 @@ export function tooltip(
...event,
nativeEvent: true,
data: {
...data,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 data 是什么结构的,拍平了放里面会不会乱?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
image

返回的都是

{
  title: string,
  items: Record[]
}

这种结构,并且这个地方...解构的数据是放在上面的,不会影响现有数据

data: dataOf(element, view),
},
});
Expand Down
Loading