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

Tooltips - Unable to resize fonts #77

Closed
dmc-cambric opened this issue Feb 23, 2024 · 3 comments
Closed

Tooltips - Unable to resize fonts #77

dmc-cambric opened this issue Feb 23, 2024 · 3 comments
Assignees
Labels
feature request New feature or request

Comments

@dmc-cambric
Copy link
Contributor

dmc-cambric commented Feb 23, 2024

Hi Team,

We've had a request from one of our clients to make the tooltip text more readable, so I've tried to increase the font size via. the tooltipTextStyle property on the ChartStyle interface.

However it seems to only increment the stroke width of the font rather than the actual size of the font. Could this be changed so that it increases the size of the text within the tooltip?

Using Ver 6.1.15

I think I've found the file that sets this value:

strokeWidth: chartStyle?.tooltipTextStyle?.size ?? 0.25,

Also a couple of visual examples:

tooltipTextStyle.size = 0.6
image

tooltipTextStyle = 3
size-3

@eatyourpeas
Copy link
Member

eatyourpeas commented Feb 26, 2024

Yes @dmc-cambric very happy to do this. Just looking at the styling of your screenshots though slightly troubled by the fact that the font in your tooltips looks to be Times New Roman, not Montserrat (see #76). Is that a deliberate choice or is the default styling in the package not working for you? Different fonts have different spacing which is set within the Victory package on which the charts are build, and this should work for Montserrat as the Victory maintainers kindly accepted a PR from us to include it.

@eatyourpeas eatyourpeas self-assigned this Feb 26, 2024
@eatyourpeas eatyourpeas added the feature request New feature or request label Feb 26, 2024
@eatyourpeas
Copy link
Member

This should be fixed in the next update:
image

toolTipMain: {
            textAnchor: "start",
            fontSize: chartStyle?.tooltipTextStyle?.size ?? 10,
            strokeWidth: 0.25,
            fill: chartStyle?.tooltipTextStyle?.colour ?? black,
            fontFamily: chartStyle?.tooltipTextStyle?.name ?? 'Montserrat',
            fontWeight: chartStyle?.tooltipTextStyle?.weight ?? 'normal',
        },

@eatyourpeas
Copy link
Member

Fixed and merged in v7.0.0. Documentation updated

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

No branches or pull requests

2 participants