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 titleSpacing option has no effect #11459

Open
Mottoweb opened this issue Aug 21, 2023 · 3 comments
Open

tooltip titleSpacing option has no effect #11459

Mottoweb opened this issue Aug 21, 2023 · 3 comments

Comments

@Mottoweb
Copy link

Expected behavior

setting following config for tooltip would have effect as per docs

plugins: {
        tooltip: {
           titleAlign: 'center',
           titleSpacing: 50,
           bodySpacing: 50,
        },
      }

Current behavior

setting following config for tooltip DOES NOT change title and body spacing of tooltip

plugins: {
        tooltip: {
           titleAlign: 'center',
           titleSpacing: 50,
           bodySpacing: 50,
        },
      }

Reproducible sample

https://codepen.io/mottoweb/pen/eYbmvYg

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

@latest

Browser name and version

No response

Link to your project

No response

@LeeLenaleee
Copy link
Collaborator

Looking at the code it seems it only applies the padding when there are multiple lines since it only applies between the lines and not around the line. Don't know if this is intended behaviour and thus a docs issue or if it is an issue with how we build the tooltip.

https://jsfiddle.net/mxdbun2z/1/

+ (titleLineCount - 1) * options.titleSpacing

@Mottoweb
Copy link
Author

This is a bit confusing since docs say: Spacing to add to top and bottom of each title line. Considering the title is usually a single item anyway.

It seems that I can solve my issue using padding and titleMargin then, thanks

@thiagogquinto
Copy link

Hey guys, I am new in open source projects so I would like to start by contributing on a small thing like a documentation fix, like what appears to be this one. I am still studying the docs, but what needs to change is the information about how the property works, right? And if possible, I would like to try to make the contribution.

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

No branches or pull requests

3 participants