i have not used reactive() in my code.. here with i have attached my coding
output$content1 <- renderUI({
output$BRANCH<-renderHighchart({
data1<-dbGetQuery(conn,"SELECT DISTINCT VBRNCH AS BRANCH, VMAJGR AS MAJOR,SUM(VNETIV) AS SALES FROM invcpf GROUP BY VBRNCH,VMAJGR")
new<-dbGetQuery(conn,"SELECT DISTINCT VBRNCH,SUM(VNETIV) AS SALES FROM invcpf GROUP BY VBRNCH")
if (input$branc == "All") {
bran<-data_frame(name=new$VBRNCH,
y=new$SALES,
drilldown=tolower(name))
second_el_to_numeric <- function(ls){
map(ls, function(x){
x[[2]] <- as.numeric(x[[2]])
x
})
}
hc <- highchart() %>%
hc_chart(type = "column") %>%
hc_title(text = "BRANCH SALES") %>%
hc_xAxis(type = "category") %>%
hc_legend(enabled = FALSE) %>%
hc_add_series(
name = "VNETIV",
colorByPoint = TRUE,
data = bran
)
hc
}
else
{
data1 <- data1[data1$BRANCH == input$branc,]
bran<-data_frame(name=data1$MAJOR,
y=data1$SALES,
drilldown=tolower(name))
second_el_to_numeric <- function(ls){
map(ls, function(x){
x[[2]] <- as.numeric(x[[2]])
x
})
}
hc <- highchart() %>%
hc_chart(type = "column") %>%
hc_title(text = "MAJORGROUP SALES") %>%
hc_xAxis(type = "category") %>%
hc_legend(enabled = FALSE) %>%
hc_add_series(
name = "VNETIV",
colorByPoint = TRUE,
data = bran
)
hc
}
})
})