Recently I was strugling with the cell visualization (progress bar) on table displayed on drill down.
Because I haven’t found any resonable source or example of how to do it, I’ve decided to share my solution here.
we have a measure with drill_fields parameter with 3 fields
measure: usage_total {
type: count drill_fields: [criteria_sub_group, criteria_name, usage_total] }
and when drill down popup appears - it looks similar to this
say we want to have these progress bars in one color (not as a gradient of values)
add another measure as a percentage of total
measure: pot {
type: percent_of_total
value_format: "0.00\%"
sql: ${usage_total} ;;
}
then add html param to visualized measure
measure: usage_total {
type: count
drill_fields: [criteria_sub_group, criteria_name, usage_total]
html:
<div style="width:100%;">
<div style="float:left; background:#A5CFE6; width:{{pot._rendered_value}}%;
height:15px; margin:3px 0px 5px 0px; padding:2px 0px 2px 0px; border-radius:1px;">
</div>
<div style="float:left; margin:4px 0px 0px 5px; font:12px Roboto; font-weight:700; text-align:left;">
{{rendered_value}}
</div>
</div>
;;
}