问题
My client wants me to create a shinydashboard
that contains this icon:
Does anyone know of a similar icon
or anything in shiny
/ shinydashboard
that allows me to put a number in the middle of a circle???
回答1:
If it is just about the icons, you will find it here:
https://fontawesome.com/icons/circle?style=regular
But if you want to show a number inside, you could do that with plain css.
library(shiny)
ui <- fluidPage(
titlePanel("Circle"),
sidebarLayout(
sidebarPanel(
includeCSS("www/style.css"),
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
tags$div(id="insidediv", textOutput("slideroutput"))
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$slideroutput <- renderText({
input$bins
})
}
# Run the application
shinyApp(ui = ui, server = server)
CSS File:
#insidediv {
background-color:#fff;
border:4.5px solid grey;
height:100px;
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
width:100px;
}
#slideroutput {
padding-top: 30px;
padding-bottom: 30px;
text-align: center;
font-weight: bold;
font-size: 24px;
}
来源:https://stackoverflow.com/questions/56239075/icon-in-shiny-shinydashboard