Reputation: 1573
I was successfull to use plotly with reactive values, but having trouble using highcharter. I'm trying to use itin my shiny app, though I can't seem to give it the inputs from reactiveValues()
Here is the code:
output$highchartGraph <- renderHighchart({
hchart(rv$userTable, "scatter", hcaes(x = rv$ColnameX,
y = rv$ColnameY)
)
rv$userTable looks different depending on user input, similar to this:
"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 have the values of needed columns to visualise, respectively.
If needed any more info, please tell.
Upvotes: 0
Views: 838
Reputation: 1573
Managed to make it work like this:
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
})
Upvotes: 2
Reputation: 183
Maybe
output$highchartGraph <- renderHighchart({
userTable <- rv$userTable
ColnameX <- rv$ColnameX
ColnameY <- rv$ColnameY
hchart(userTable, "scatter", hcaes(x = ColnameX,
y = ColnameY)
)
})
Is gut to test print(class(userTable)), print(class(ColnameX))
Upvotes: 1