Thermometer Chart/ Slider Chart

DickyMohanty
Participant III

Hello Experts, 

I have a requirement to show the KPI in a slider format/thermometer chart, like the image below.

I do have KPI/measure created in my Explore for: “Total Spend” , “Needed for Next Tier”. 

The values displayed above the Thermometer bar are the Tiers, on which the the “Total Spend” value has to fall. 

These Tiers have to be built as a Dimension with Tier type? 
Can someone help me with ideas/suggestions in getting this layout designed? 

076fe6a1-4a3a-4a62-b85e-1a364a88168a.png
1 8 749
8 REPLIES 8

DickyMohanty
Participant III

Hi @brecht ,

Can you suggest this with your expertise? :slight_smile:

DickyMohanty
Participant III

Hello Experts,

Any possible suggestions here? 

Will this reference can be tweaked or helpful for my type of layout - https://looker.com/platform/blocks/viz/liquid-fill-gauge

Hi @DickyMohanty,

You potentially could do something like this:
 

  measure: count {
type: count
html:
{% if value < 100 %}
<div class="vis" style="width: 400px; background-color: #808080; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px">

<div class="vis-single-value" style="background-color: red; font-color:white; width: 200px; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px;">{{ rendered_value }}</div></div>

{% elsif value >1000 %}
<div class="vis" style="width: 400px; background-color:#808080; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px">
<div class="vis-single-value" style="background-color: blue; font-color:white; width: 300px; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px;">{{ rendered_value }}
</div></div>
{% else %}
<div class="vis" style="width: 400px; background-color: #808080; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px">
<div class="vis-single-value" style="background-color: black; font-color:white; width: 400px; border: 2px solid #000;
border-radius: 15px; -moz-border-radius: 15px;">{{ rendered_value }}
</div></div>
{% endif %};;
}
}

This dynamically sets which div we use based on the value of the count. The result looks like this, but you can definitely add more styling. 

591c81cc-6f8d-4201-b41b-90cef7f1a23b.png


Please let me know if you have any questions!

Thanks,

Eric

DickyMohanty
Participant III

Hi @Eric_Lyons ,

Thanks much for helping with a start. I am quite new to Looker and learning now. Also is there any good learning portal to how to use HTML for LookML? 

Can you also help in how to mark those scale on the bar and the arrow with KPI (as shown in the design) ?

Can you also help in explaining/details of each line of script? 

Regards!

DickyMohanty
Participant III

Hi @Eric_Lyons ,

Happy New Year and hope you are keeping safe!

Can you help me in how to mark those scales on the bar and the upwards arrow with KPI (as shown in the design) ?

Hi @DickyMohanty,

You would most likely need to place an image of the arrow based on the value. Similar to conditional we have based on value which alters which div we use, you would want to place the arrow n pixels away from the left axis. 

Thanks,

Eric

DickyMohanty
Participant III

Thank you for response. @Eric_Lyons . 

Yes, the arrow has to be dynamic as well. it would move forward/backward based on the $ value. 

I am still new to Looker HTML. Can you please share some more examples the way you have suggested above. 

Regards!

I would also be interested in some examples of HTML usage to customize LookML

Top Labels in this Space
Top Solution Authors