rAmCharts - amSolidGauge

Parameters

  • x: numeric, equal to the value for which the solid gauge is desired.
  • min: a numeric, minimum possible value.
  • max: a numeric, maximum possible value.
  • type: a character, type of gauge : “full” or “semi”.
  • width: a numeric, width of the gauge.
  • color: a character, hexadecimal color value or a vector of colors.
  • text: a character, text to add to the printed value.
  • textSize: a numeric, size of text.
  • : other parameters called in amOptions.

Reference example

amSolidGauge(x = 65)

Change min and max values

amSolidGauge(x = 65, min = 0, max = 200)

Semi Solid Gauge

amSolidGauge(x = 65, type = "semi")

Change width

amSolidGauge(x = 65, width = 50)

Change color

amSolidGauge(x = 65, color = "#2F4F4F")

Put a color scale

      amSolidGauge(x = 10, color = c("#00ff00", "#ffd700", "#ff0000"))
      amSolidGauge(x = 35, color = c("#00ff00", "#ffd700", "#ff0000"))
      amSolidGauge(x = 70, color = c("#00ff00", "#ffd700", "#ff0000"))
      amSolidGauge(x = 90, color = c("#00ff00", "#ffd700", "#ff0000"))

Add some text to the printed value

amSolidGauge(x = 65, text = "%")

Modify textSize value

amSolidGauge(x = 65, text = "%", textSize = 50)

amOptions

export

amSolidGauge(x = 65, export = TRUE)
#or
amSolidGauge(x = 65) %>>% 
  amOptions(export = TRUE)

exportFormat

amSolidGauge(x = 65, export = TRUE, exportFormat = "JPG")
#or
amSolidGauge(x = 65) %>>% 
  amOptions(export = TRUE, exportFormat = "JPG")

main and creditsPosition

amSolidGauge(x = 65, main = "My Gauge",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "bottom-right")
#or
amSolidGauge(x = 65) %>>% 
  amOptions( main = "My Gauge",
        mainColor = "#68838B", mainSize = 25, creditsPosition = "bottom-right")