Is there any way to change the units size?

I’ve been looking tirelessly for away to edit the unit font-size. Here we use an unit that is Kgf/cm² for example which eats too much space on a Stat Panel. I’ve tried editing the CSS but since the unit doesn’t have a class of it’s own I can’t edit it’s size that way. I’ve looked into the grafana files but I found nothing. Does anyone have any idea how i can edit the unit font-size?

Hi @ryuunosukeds3,

What version of grafana are you using? I added your custom unit to some dummy stat panels in v7.4.5, but it looks like the text dynamically scales pretty well:

Hello, @mattabrams.

I’m also using v7.4.5. while the unit scaling might seem ok for general purpose, in my company we use it on big tvs hanging on the wall so ppl would appreciate to see the number from far away. Since we have way too much info on the screen making the unit smaller in order to make the number bigger was vital to our work environment. With that said, I actually managed to make the units smaller with some CSS trickery using the Boom theme Panel. Here is the code to do it:

.panel-content.panel-content--no-padding > div > div > div > div > div > div > span:nth- 
child(2) {
     font-size: 15px !important;
}

Here’s how it looks like:
image

With that, I can optmize the space on my dashboard. Would be really nice if it was possible to natively set unit font size, tho.

Thanks for your answer!

EDIT: Fixed some typos and uploaded an img with the custom unit.

1 Like

Nice work!

You know, if you wanted you could create a feature request for this. If it got enough upvotes it could get traction with the squads…

1 Like

This topic was automatically closed after 365 days. New replies are no longer allowed.