inst/shiny/src/xy/amxy_server.R

output$amxy0 <- rAmCharts::renderAmCharts({
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y)
})



output$code_amxy0 <- renderText({
  "
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y)
  "
})


output$amxy1 <- rAmCharts::renderAmCharts({
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y, zoom = TRUE, scrollbar = TRUE)
})

output$code_amxy1 <- renderText({
  "
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y, zoom = TRUE, scrollbar = TRUE)
  "
})



output$amxy2 <- rAmCharts::renderAmCharts({
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y, type = 'p', weights = rnorm(100, sd = 5), main = 'My XY', col = 'blue')
})

output$code_amxy2 <- renderText({
  "
  ##Data
  x <- sort(rnorm(100))
  y <- rnorm(100, sd = 10)
  ##Plot
  amPlot(x = x, y = y, type = 'p', weights = rnorm(100, sd = 5), main = 'My XY', col = 'blue')
  "
})


output$amxy3 <- rAmCharts::renderAmCharts({
  ##Data
  x <- sort(rnorm(100))
  y1 <- rnorm(100, sd = 10)
  y2 <- rnorm(100, sd = 10)
  y3 <- rnorm(100, sd = 10)
  ##Plot
  pipeR::pipeline(
  amPlot(x = x, y = y1),
    amLines(x = y2, col = 'blue', type = 'p' ),
    amLines(x = y3, type = 'p')
  )
  
})

output$code_amxy3 <- renderText({
  "
  ##Data
  x <- sort(rnorm(100))
  y1 <- rnorm(100, sd = 10)
  y2 <- rnorm(100, sd = 10)
  y3 <- rnorm(100, sd = 10)
  ##Plot
  pipeR::pipeline(
    amPlot(x = x, y = y1),
    amLines(x = y2, col = 'blue', type = 'p' ),
    amLines(x = y3, type = 'p')
  )
  "
})

Try the rAmCharts package in your browser

Any scripts or data that you put into this service are public.

rAmCharts documentation built on Sept. 30, 2022, 5:06 p.m.