# NOT RUN {
# a grouped radial bar chart ####
set.seed(666)
dat <- data.frame(
  country = c("USA", "China", "Japan", "Germany", "UK", "France"),
  visits = c(3025, 1882, 1809, 1322, 1122, 1114),
  income = rpois(6, 25),
  expenses = rpois(6, 20)
)
amRadialBarChart(
  data = dat, data2 = dat,
  width = "600px", height = "600px",
  category = "country",
  values = c("income", "expenses"),
  valueNames = list(income = "Income", expenses = "Expenses"),
  showValues = FALSE,
  tooltip = amTooltip(
    textColor = "white",
    backgroundColor = "#101010",
    borderColor = "silver"
  ),
  draggable = TRUE,
  backgroundColor = "#30303d",
  columnStyle = list(
    income = amColumn(
      color = "darkmagenta",
      strokeColor = "#cccccc",
      strokeWidth = 2
    ),
    expenses = amColumn(
      color = "darkred",
      strokeColor = "#cccccc",
      strokeWidth = 2
    )
  ),
  chartTitle = "Income and expenses per country",
  xAxis = list(
    labels = amAxisLabelsCircular(
      radius = -82, relativeRotation = 90
    )
  ),
  yAxis = list(
    labels = amAxisLabels(color = "orange"),
    gridLines = amLine(color = "whitesmoke", width = 1, opacity = 0.4),
    breaks = amAxisBreaks(values = seq(0, 40, by = 10))
  ),
  yLimits = c(0, 40),
  valueFormatter = "#.#",
  caption = amText(
    text = "Year 2018",
    fontFamily = "Impact",
    fontSize = 18
  ),
  theme = "dark")
# just for fun ####
dat <- data.frame(
  cluster = letters[1:6],
  y1 = rep(10, 6),
  y2 = rep(8, 6),
  y3 = rep(6, 6),
  y4 = rep(4, 6),
  y5 = rep(2, 6),
  y6 = rep(4, 6),
  y7 = rep(6, 6),
  y8 = rep(8, 6),
  y9 = rep(10, 6)
)
amRadialBarChart(
  data = dat,
  width = "500px", height = "500px",
  innerRadius = 10,
  category = "cluster", values = paste0("y", 1:9),
  showValues = FALSE,
  tooltip = FALSE, draggable = FALSE,
  backgroundColor = "black",
  columnStyle = amColumn(strokeWidth = 1, strokeColor = "white"),
  cellWidth = 96,
  xAxis = list(labels = FALSE),
  yAxis = list(labels = FALSE, gridLines = FALSE),
  yLimits = c(0, 10),
  legend = FALSE,
  theme = "kelly")
# }
Run the code above in your browser using DataLab