I am building a shiny application.
I am plotting charts using ggplot.
When I mouseover the points on the graph, I want a tooltip showing one of the columns in the data frame (customizable tooltip)
Can you please suggest the best way forward.
Simple App:
# ui.R
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
h4("TEst PLot")),
mainPanel(
plotOutput("plot1")
)
)
))
# server.R
library(ggplot2)
data(mtcars)
shinyServer(
function(input, output) {
output$plot1 <- renderPlot({
p <- ggplot(data=mtcars,aes(x=mpg,y=disp,color=factor(cyl)))
p <- p + geom_point()
print(p)
})
}
)
When I mouse over the points, I want it to show mtcars$wt
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…