R显示barPlot标签

时间:2017-09-15 15:19:26

标签: r shiny bar-chart

美好的一天可以在这里显示标签吗?

image-label

是barPlot。

output$bar<-{(renderPlot(barplot(data_percent,names.arg =tableData$Country,col=rainbow(length(tableData$Country)))) )}

1 个答案:

答案 0 :(得分:4)

以下是highcharter包的示例:

library(shiny)
library(highcharter)
library(ggplot2)

ui <- list(highchartOutput("hcontainer",height = "400px",width = "500px"))

server <- function(input, output) {
  output$hcontainer <- renderHighchart({
    hchart(diamonds$cut, type = "column",dataLabels = list(enabled=TRUE))
  })
}

shinyApp(ui, server)

enter image description here