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

Add additional date on tooltip #112

Open
hnfishwu opened this issue Mar 25, 2022 · 4 comments
Open

Add additional date on tooltip #112

hnfishwu opened this issue Mar 25, 2022 · 4 comments

Comments

@hnfishwu
Copy link

hnfishwu commented Mar 25, 2022

I would like to add more additional data on tooltip.
I know I can use myChart.zDataLabel('<div>Additional <b>data</b></div>') to add more text.

But I want to show different text on different segments.
Is it possible?
Thanks.

@vasturiano
Copy link
Owner

@hnfishwu you can use .segmentTooltipContent for that purpose.

@hnfishwu
Copy link
Author

@vasturiano

Could you give me some example to use this .segmentTooltipContent ?
I have tried this but the tooltip only can show the val or timerange.
I would like to show different tooltip on different segment , and the tooltip is not val or timerange.

Do you have any suggestion?
Thanks.

@vasturiano
Copy link
Owner

@hnfishwu the segment data is included in the callback function of .segmentTooltipContent.
So you can do something like:

.segmentTooltipContent(d => d.data.myCustomTooltipText)

@hnfishwu
Copy link
Author

@vasturiano
Thanks a lot.
It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants