You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I reverse the colors? When the gauge is low I'd like it to be green instead of red, and vice versa. Thanks in advance for your help with my rookie question! I'm using the built-in gaugeOutput function in R that I've pasted below. Unfortunately I don't know Java, can only code in R - do you know if/how I could modify this function to pass in the "levelColors" argument?
Its almost a year since this question was posted so I give you my hack solution.
Find the R file called something like "justgage.1.0.1.min.js". Mine is in /usr/local/lib/R/site-library/ShinyDash/shinyDash/justgage/
In vim/nano/emacs find the line reading percentColors=["#f9c802","#a9d70b","#ff0000"] its about 2/3rd of the way in.
Change the color codes as desired. To reverse the codes it will become:
percentColors=["#ff0000","#f9c802","#a9d70b"]. Restart shiny and voila BUT if you break something forget you ever read this.
How can I reverse the colors? When the gauge is low I'd like it to be green instead of red, and vice versa. Thanks in advance for your help with my rookie question! I'm using the built-in gaugeOutput function in R that I've pasted below. Unfortunately I don't know Java, can only code in R - do you know if/how I could modify this function to pass in the "levelColors" argument?
function (outputId, title = "Title", min = 0, max = 1, units = "",
width = "200px", height = "200px", value = min)
{
tagList(singleton(tags$head(initResourcePaths(), tags$script(src = "shinyDash/justgage/justgage.1.0.1.min.js"),
tags$script(src = "shinyDash/justgage/raphael.2.1.0.min.js"),
tags$script(src = "shinyDash/justgage/justgage_binding.js"))),
tags$div(id = outputId, class = "justgage_output", style = paste("width:",
validateCssUnit(width), ";", "height:", validateCssUnit(height),
";")), tags$script(paste("GageOutput('", outputId,
"',\n '", title, "',\n '",
min, "',\n '", max, "',\n '",
units, "',\n '", validateCssUnit(width),
"',\n '", validateCssUnit(height),
"',\n '", value, "')", sep = "")))
}
The text was updated successfully, but these errors were encountered: