简体   繁体   English

Shiny / Shinydashboard中的图标

[英]Icon in shiny/ shinydashboard

My client wants me to create a shinydashboard that contains this icon: 我的客户希望我创建一个包含以下图标的shinydashboard

在此处输入图片说明

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??? 或任何shiny / shiny shinydashboard中的东西,允许我在圆圈中间放置一个数字???

If it is just about the icons, you will find it here: 如果只是图标,您将在这里找到它:

https://fontawesome.com/icons/circle?style=regular https://fontawesome.com/icons/circle?style=regular

But if you want to show a number inside, you could do that with plain css. 但是,如果您想在内部显示一个数字,则可以使用纯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: CSS文件:

#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;
}

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM