Skip to content

Instantly share code, notes, and snippets.

@tiagochst
Created June 7, 2017 23:30
Show Gist options
  • Save tiagochst/fdca88074181b276165ba34d5c6ff397 to your computer and use it in GitHub Desktop.
Save tiagochst/fdca88074181b276165ba34d5c6ff397 to your computer and use it in GitHub Desktop.
Error in safari
# Contributed by Joe Cheng, February 2013
# Requires googleVis version 0.4.0 and shiny 0.4.0 or higher
# server.R
library(googleVis)
library(shiny)
shinyServer(function(input, output) {
output$view <- renderGvis({
Pie1 <- gvisPieChart(CityPopularity)
## Doughnut chart - a pie with a hole
Pie2 <- gvisPieChart(CityPopularity, options=list(
slices="{4: {offset: 0.2}, 0: {offset: 0.3}}",
title='City popularity',
legend='none',
pieSliceText='label',
pieHole=0.5))
gvisMerge(Pie2, Pie1)
})
output$view2 <- renderGvis({
gvisPieChart(CityPopularity)
})
output$view3 <- renderGvis({
gvisPieChart(CityPopularity, options=list(
slices="{4: {offset: 0.2}, 0: {offset: 0.3}}",
title='City popularity',
legend='none',
pieSliceText='label',
pieHole=0.5))
})
})
shinyUI(fluidPage(
fluidRow(
mainPanel(
htmlOutput("view"),
htmlOutput("view2"),
htmlOutput("view3")
))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment