Skip to content

rHighcharts with events not working correctly #6

@cls3415

Description

@cls3415

I've been trying to use rHighcharts with events in Shinydashboard, but I couldn't get things right. It will show the "pointer", but not the alert window. Can anyone help?

Thanks!!

server.R

require(rHighcharts)

server <- shinyServer(function(input, output) {
output$myChart2 <- renderChart({
h1 <- rHighcharts:::Chart$new()
h1$chart(type = "column", polar = FALSE)
h1$plotOptions(
series = list(
cursor = 'pointer',
point = list(
events = list(
click = "function () {alert('value: ' + this.y);}"
)
)
)
)
h1$data(c(1, 3, 2, 4, 5, 4, 6, 2, 3, 5, NA), dashStyle = "longdash")
h1$data(c(NA, 4, 1, 3, 4, 2, 9, 1, 2, 3, 4), dashStyle = "shortdot")
h1$legend(symbolWidth = 80)

return(h1)
})
})
ui.R

require(googleVis)
shinyUI(pageWithSidebar(
headerPanel("", windowTitle="Example googleVis with interaction"),
sidebarPanel(
tags$head(tags$style(type='text/css', "#selected{ display: none; }")),
selectInput("dataset", "Choose a dataset:",
choices = c("pressure", "cars")),
uiOutput("selectedOut")
),
mainPanel(
tabsetPanel(
tabPanel("Main",
htmlOutput("view"),
plotOutput("distPlot", width="300px", height="200px")),
tabPanel("About", 'http://www.google.com'
))))
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions