inst/modules/server.R

# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#


shinyServer(function(session, input, output) {
  
  data <- reactive({
    data_global
  })
  
  res_1 <- callModule(rAmChartsTimeSeriesServer, "ts_1", data, reactive("date"), 
                      reactive("value"), main = reactive("Series 1"),
                      color = reactive("red"), group = reactive("sh"))
  
  res_2 <- callModule(rAmChartsTimeSeriesServer, "ts_2", data, reactive("date"), 
                      reactive("value2"), main = reactive("Series 2"),
                      color = reactive("red"), group = reactive("sh"))
  

  output$am1 <- renderAmCharts({
    amTimeSeries(data_stock_2[1:100, ], "date", c("ts1", "ts2"), group = "sh2")
  })
  
  output$am2 <- renderAmCharts({
    amTimeSeries(data_stock_2[1:100, ], "date", c("ts1", "ts2"), group = "sh2")
  })
  
  output$am3 <- renderAmCharts({
    amTimeSeries(data_stock_2[1:100, ], "date", c("ts1", "ts2"), group = "sh2")
  })
  
  output$am4 <- renderAmCharts({
    amTimeSeries(data_stock_2[1:100, ], "date", c("ts1", "ts2"), group = "sh2")
  })
})

Try the rAmCharts package in your browser

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

rAmCharts documentation built on June 21, 2018, 5:03 p.m.