当我选择下拉值时需要条形图中的数据图

时间:2019-03-30 07:15:20

标签: r shinydashboard

当我在下拉菜单中选择状态时,所需的数据意味着年份和帐单金额未在条形图中绘制。

size1 <- input$Size1
      print(size1)
      y21 =dbSendQuery(mydb,'select bs.status,count(*) as bill_count, bs.status,pbi.service_date
                        from patient_bill_info pbi inner join emedadminmaster.bill_status bs on bs.status_code = pbi.sent_to_billing
                        where pbi.sent_to_billing!="c" and pbi.service_date >="2018-01-01" and pbi.service_date<="2019-01-31"
                        group by pbi.sent_to_billing;')

      y=fetch(y21,n=-1)
     y211<-y[grep(size1,y$status,ignore.case = T),]
       y20<-as.matrix(data.frame(y211$year,y211$bill_count))
      y20barchart<- gvisBarChart(y20)
      return(y20barchart)
    })
status =dbSendQuery(mydb,'select bs.status,count(*) as bill_count, bs.status,pbi.service_date
from patient_bill_info pbi inner join emedadminmaster.bill_status bs on bs.status_code = pbi.sent_to_billing
                    where pbi.sent_to_billing!="c" and pbi.service_date >="2018-01-01" and pbi.service_date<="2019-01-31"
                    group by pbi.sent_to_billing;')

y=fetch(status,n=-1)

Size1 <-y$status

0 个答案:

没有答案