Forum Discussion
Sorry, but I can't really help with that code.
I do have some code from Kirk Trachey magic buttons app.
var text redbox = "https://i.imgur.com/yJEyaf7.png"; // red
var text yellowbox = "https://i.imgur.com/5DhaU3e.png"; // yellow
var text greenbox = "https://i.imgur.com/gR9BVs6.png"; // green
var text graybox = "https://i.imgur.com/h3f203O.jpg"; // gray
var text orangebox = "https://i.imgur.com/ogUnxiE.png"; // orange
var text box = If([Performance]<0.6,$greenbox, If([Performance]<0.9,$yellowbox,$redbox));
var text widthval ="\"" &Min(Max([Performance]*200,0),200)&"\"";
var text widthvalbalance ="\"" &ToText(Max(0,Min(200,200-([Performance]*200))))&"\"";
"<div style='position:relative;color:white;'>" &
"<div style=\"width: 200px; \"><img height = 18 width="&$widthval & "src=\""&$box&"\" title='Performance: " & Round([Performance]*100) & "%' />" &"<img height = 18 width="&$widthvalbalance&"src=\""&$graybox&"\" title='Remaining: " & Round((1-[Performance])*100) & "%'/></div>"
& "<div style='position:absolute;top:2px;left:2px;'>"&Round(([Performance])*100)&"%</div>"
& "<div style='position:absolute;top:2px;left:171px;'>"&Round((1-[Performance])*100)&"%</div>"
// TO REMOVE THE DISPLAYED NUMBERS SIMPLY PUT // INFRONT OF LINE 11 AND 12 ABOVE
// This is referencing a [Performance] formula field that is measuring "Performance" against an "SLA Max".
// There are 2500 other graphics available for your QuickBase application at: https://www.quickbase.com/db/9kaw8phg?a=ShowPage&pageid=134. This bar changes color when a threshold has been met.
// This formula was built upon the original code of Sam Jones and subsequent refinements by Avinash Sikenpore