Skip to content Skip to sidebar Skip to footer

Hover Style Of Label In Googlevis

I'm trying to change the style of hover-label in googleVis columnChart. I'd like to format large numbers as it is done on axis. Do you know how to manage it (I've read whole Intern

Solution 1:

You can create an extra column variable with the text you want to display and pass a vector of y-variables, giving the label aame ending in ".tooltip". The tooltip can be styled with html tags. format with big.mark can add commas in R.

shinyServer(function(input, output) {

    d <- iris %>% group_by(Species) %>% summarise(ile=1e6*sum(Sepal.Length))
  d$ile.tooltip <- sprintf("<p><b>%s</b><br/><b>%s</b></p>", 
    d$Species, format(d$ile, big.mark=","))

  output$wyk <- renderGvis({
    gvisBarChart(d, xvar = "Species", yvar = c("ile", "ile.tooltip"),
      options=list(legend="top", 
        tooltip="{isHtml:'True'}",  # so you can format it with html
        bar="{groupWidth:'90%'}", height=500))
  })
})

Post a Comment for "Hover Style Of Label In Googlevis"