Question

Is there a way to change font size in "SINGLE VALUE" Visualizations

  • 23 August 2016
  • 31 replies
  • 3670 views

Userlevel 1

HI all I am trying to change font size of single value visualizations kindly provide solution for my problem.


Thank You


31 replies

Userlevel 5
Badge

Hi @arigela_vignesh, that isn’t currently possible but I will let the product team know you’re interested in this!

I really need this too 🙂 Is there a better way to vote for a product suggestion rather that replying to a thread like I am doing now?

Userlevel 5
Badge

@Aron_Clymer Responding to a discourse post is a great way to let us know that you’re interested in a suggested product idea. You can also visit help.looker.com if you’re more comfortable writing an email.

The documentation here states that you can do this using


font_size: small | medium | large


But this does not appear to work.

Userlevel 2

Hello @srivera, are you building a User Defined Dashboard or a LookML dashboard?

I’m building LookML dashboards.

Userlevel 2

Hi @srivera, it looks like we have stopped supporting font_size for single value visualizations. I’ll work on getting that removed from the docs.

Not a problem. I figured that was the case since changing the font size mixed with the dynamic dashboard layouts could be difficult.


Thanks for the update.

Will you be bringing it back? Would be useful if we could adjust the size of the Single Value.

Userlevel 3

Hi @p_talkad, I’ll let the product team know that this is a feature that you’re interested in. For now, you should be able to accomplish this with html formatting like so:


dimension: formatted_field
sql: ${TABLE}.field_name
html: <font size="10">{{ value }}</font>
Userlevel 1

I’m also interested in this. There are times that I want a specific single value to be much larger than other single values. Currently even when using the font size property in html, all fonts are resized to the same size, which defeats the purpose.


Can this be raised?

Userlevel 3
Badge

@Matthew.Darwin, yes I will let our team know that you will want to have control over the font size in the option of the Single Value visualization.

For the time being, if you try to apply this to one specific Single Value viz, I would suggest making an additional measure, using the same code but changing the html for that new field and define the Single Viz on this measure to show it larger than other Single Viz using the same data.

Userlevel 1

Hi Romain; unfortunately that doesn’t work. The displayed text size is the same for all single value tiles on the dashboard.


The dimensions in the following image are coded thus:-


  dimension: email {
type: string
sql: ${TABLE}.Email ;;
description: "The Agent's email address"
html: <font size="20">{{ value }}</font> ;;
}

dimension: name {
type: string
sql: ${TABLE}.Name ;;
description: "The Agent's name."
html: <font size="50">{{ value }}</font> ;;
}

Yet in the dashboard they are sized the same.



It looks like whatever the size is specified as, it is then being overriden by the single value wrapper class.

Userlevel 3
Badge

I see, thank you for the update Matthew. I am relaying this to our product team now!

Matt, my hack, if you can call it that, was to use a table visualization for HTML measure instead of single value visualization.Table Viz respects the HTML formatting better. I would then hide the row number, other dimensions and use soft hypen as the column header name for the HTML measure. It is not clean, but works.


Userlevel 1

Thanks Romain.

Userlevel 1

It is a bit hacky, but that does work to an extent. Nice touch with the soft hypen as the column header.


As someone fairly new to Looker, how do you change the background colour of the header bar in the table, however?

From the Edit menu on the right, choose the Table Theme that works for you.

I’m interested in that too, can you provide more info please! Can’t handle other forums, i know you can help!

Hi All,


Below html in LookML works fine for “SINGLE VALUE” Visualizations.


html:

{{ rendered_value }}

;;

Thanks,

Kaushal

Added a snapshot


Userlevel 1

Ah, so in order to be able to specify the size in the html we need to use rendered value, not value? Seems counter intuitive to mean, given the documentation refers to rendered value being the default formatting for Looker, but we can work with that.

Userlevel 3

Hey @Matthew.Darwin, you should also be able to use {{value}}. For example,


html: <p style="color: red; font-size: 50px"> {{ value }} </p> ;;

As you mentioned, rendered value is used when we want to apply Looker’s value formatting.

I know this is an old topic but doesn’t seem to be added as a feature? I’m looking for a way of doing this in the configuration of the tile and not in a static way (i.e. via LookML code)

Userlevel 4

Note that you could use the new Multiple Value Visualization from the marketplace. You can display just one value with it and have the ability to set the font size.

Reply