簡體   English   中英

通過reactValues()使用highcharter和r shine

[英]Using highcharter and r shiny with reactiveValues()

我成功地使用了帶有反應性值的散點圖,但是在使用highcharter時遇到了麻煩。 我正在嘗試在閃亮的應用程序中使用它,盡管我似乎無法提供它來自reactValues()的輸入

這是代碼:

output$highchartGraph <- renderHighchart({
    hchart(rv$userTable, "scatter", hcaes(x = rv$ColnameX,
                                          y = rv$ColnameY)
    )

rv $ userTable視用戶輸入而有所不同,類似於:

         "Date" "sulfate" "nitrate" "ID"
32 "2002-02-01"      2.07     0.774    8
38 "2002-02-07"      3.25     1.280    8
44 "2002-02-13"      1.68     1.140    8
62 "2002-03-03"      1.85     1.310    8
74 "2002-03-15"      5.72     0.599    8
80 "2002-03-21"      6.71     1.390    8

rv $ ColnameX / Y分別具有可視化所需列的值。

如果需要更多信息,請告知。

也許

   output$highchartGraph <- renderHighchart({
       userTable <- rv$userTable
       ColnameX <- rv$ColnameX
       ColnameY <- rv$ColnameY
       hchart(userTable, "scatter", hcaes(x = ColnameX,
                                             y = ColnameY)
       )
   })

是否可以測試print(class(userTable)),print(class(ColnameX))

設法使它像這樣工作:

highchartGraph <- renderHighchart({
        userTable <- rv$userTable
        X <- rv$ColnameX
        Y <- rv$ColnameY
        outp <- highchart() %>%
            hc_title(text = "highcharter") %>%
            hc_add_series(data = cbind(userTable[[X]], userTable[[Y]]),
                          type = "scatter")
        outp
    })

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM