📜  R中的ggplot如何通过悬停显示信息-无论代码示例

📅  最后修改于: 2022-03-11 14:55:42.549000             🧑  作者: Mango

代码示例2
p <- ggplot(data = df, aes(x = Date, y = Revenue, group = 1,
            text = paste("Date: ", Date,
                         "
Revenue: $", Revenue,                          "
Target: $", Target) )) +    geom_line(colour = "grey", aes(Date, Target)) +    geom_line(colour = "#408FA6") ggplotly(p, tooltip = "text")