rAmCharts - amAngularGauge

Parameters

  • x: numeric, equal to the value for which the angular gauge is desired.
  • start: a numeric, minimum value allowed.
  • end: a numeric, maximum value allowed.
  • step: a numeric, intervals size.
  • bands: a data frame with 4 columns : start (numeric, minimal value for the band), end (numeric, maximal value for the band), color (character, color of the band, in hexadecimal) and width (numeric, width of the band). If the last column is not defined, it is auomatically set to 10.
  • text: a character, text legend.
  • textSize: a numeric, size of text.
  • secondAxe: a boolean, TRUE if two axes are desired. Default is set to FALSE.
  • start2: a numeric, minimum value allowed for the second axe if secondAxe is TRUE.
  • end2: a numeric, maximum value allowed for the second axe if secondAxe is TRUE.
  • bands2: a data frame with 4 columns : start (numeric, minimal value for the band), end (numeric, maximal value for the band), color (character, color of the band, in hexadecimal) and width (numeric, width of the band). If the last column is not defined, it is auomatically set to 10.
  • : other parameters called in amOptions.

Reference example

amAngularGauge(x = 25)

Add colored bands

bands = data.frame(start = c(0, 40, 60), end = c(40, 60, 100), 
                   color = c("#00CC00", "#ffac29", "#ea3838"),
                   stringsAsFactors = FALSE)
amAngularGauge(x = 25, bands = bands)

Add text

amAngularGauge(x = 25, text = "km/h")

Two axis

bands2 = data.frame(start = c(100, 130, 170), end = c(130, 170, 200), 
                   color = c("#00CC00", "#ffac29", "#ea3838"),
                   stringsAsFactors = FALSE)
amAngularGauge(x = 25, start = 0, end = 100, bands = bands,
               secondAxe = TRUE, start2 = 100, end2 = 200, bands2 = bands2)

amOptions

export

amAngularGauge(x = 25, export = TRUE)
#or
amAngularGauge(x = 25) %>>% 
  amOptions(export = TRUE)

exportFormat

amAngularGauge(x = 25, export = TRUE, exportFormat = "JPG")
#or
amAngularGauge(x = 25) %>>% 
  amOptions(export = TRUE, exportFormat = "JPG")

main and creditsPosition

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

theme

amAngularGauge(x = 25, theme = "patterns")
#or
amAngularGauge(x = 25) %>>% 
  amOptions(theme = "patterns")