tremorlabs / tremor

React components to build charts and dashboards
https://npm.tremor.so
Apache License 2.0
16.22k stars 467 forks source link

[Bug]: Scatter chart x axis label is truncated (below the line height) #1095

Open joaoaguiam opened 4 months ago

joaoaguiam commented 4 months ago

Tremor Version

3.17.2

Link to minimal reproduction

https://gist.github.com/joaoaguiam/bd5b464221b7887e273a90f5c96e04c9

Steps to reproduce

Copy paste that gist to your project. This is the default example of scatter with a xAxis label. As the axis has a y, the part that is below the line is truncated. Check image. CleanShot 2024-06-29 at 15 06 29@2x

By inspecting the code, the dy property is set to 0em. if I change to -0.5em, the word becomes fully visible. CleanShot 2024-06-29 at 15 07 36@2x

What is expected?

The word should be fully visible and not only partially

What is actually happening?

The part of the word below the line is not visible

What browsers are you seeing the problem on?

Chrome

Any additional comments?

No response

severinlandolt commented 4 months ago

Hi! What font and default font size are you using?

FlorianStorz commented 3 days ago

Hi, I just stumbled over the same issue like @joaoaguiam as you can see in the following image, where the "g" is cut off.

image

If I change the dy property to -0.5em, it also becomes fully visible to me.

In my case I used the font "Inter" from "next/font/google" with the following default font sizes: fontSize: { "tremor-label": ["0.75rem"], "tremor-default": ["0.875rem", { lineHeight: "1.25rem" }], "tremor-title": ["1.125rem", { lineHeight: "1.75rem" }], "tremor-metric": ["1.875rem", { lineHeight: "2.25rem" }], },

Are there any plans to address this issue?

Please let me know if I should provide more details.

Thanks in advance!