Learn R Programming

rAmCharts (version 2.1.7)

amOptions: amOptions

Description

amOptions sets the most common options for chart customization. You can set other properties with the method setProperties. See details for exception.

Usage

amOptions(chart, theme = c("none", "light", "dark", "patterns", "chalk"),
  legend = FALSE, legendPosition = "right", legendAlign = "left",
  export = FALSE, exportFormat = character(),
  creditsPosition = "top-left", main = character(), mainColor = "#000000",
  mainSize = 15, zoom = FALSE, scrollbar = FALSE, scrollbarHeight = 20,
  valuescrollbar = FALSE, valuescrollbarHeight = 20, labelRotation = 0,
  ...)

Arguments

chart

'>AmChart.

theme

character, possible values are : "none", "light", "dark", "patterns", "chalk", default set to "none".

legend

logical, default FALSE. TRUE to add a legend to the chart.

legendPosition

character, possible values are : "left", "right", "top" or "bottom", default set to "right".

legendAlign

character, controls the legend alignement. Possible values are : "left","right" or "center", default set to "left". Only used if legend = TRUE.

export

logical, default set to FALSE. TRUE to display export feature.

exportFormat

character, desired export format. Possible values are : "JPG", "PNG" ,"SVG", "CSV", "JSON", "PDF", "XLSX", "PRINT".

creditsPosition

character, controsl credits position. Possible values are : "top-left", "top-right", "bottom-left" or "bottom-right", default set to "top-left".

main

character, chart's title.

mainColor

character, main color (in hexadecimal), default set to "#000000".

mainSize

numeric, main size, default set to 15.

zoom

logical, TRUE to add a chart cursor, default set to FALSE.

scrollbar

logical, default FALSE, TRUE to display scrollbar.

scrollbarHeight

numeric, height in pixels, must be > 0.

valuescrollbar

logical, default FALSE, TRUE to display valuescrollbar.

valuescrollbarHeight

numeric, height in pixels, must be > 0.

labelRotation

numeric, rotation angle of a label. Only horizontal axis' values can be rotated. Value must be between -90 and 90.

...

Other properties added to the chart using setProperties.

Details

Exception:

  • It's not possible to export a gauge chart data as CSV.

See Also

Examples

Run this code
# NOT RUN {
library(pipeR)
data(data_pie) 

# Export                 
amPie(data = data_pie) %>>%
  amOptions(export = TRUE)

# Legend
amPie(data = data_pie) %>>%
  amOptions(legend = TRUE)

# Legend position
amPie(data = data_pie) %>>%
  amOptions(legend = TRUE, legendPosition = "bottom")

# Credits position
amPie(data = data_pie) %>>%
  amOptions(creditsPosition = "bottom-right")

# Theme
amPie(data = data_pie) %>>%
  amOptions(theme = "chalk")

# Title
amPie(data = data_pie) %>>%
  amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40, theme = "chalk")


# Custom exemple
amPie(data = data_pie) %>>%
  amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40,
            theme = "dark", legend = TRUE, legendPosition = "bottom",
            creditsPosition = "bottom-right" )
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab