簡體   English   中英

Shiny / Shinydashboard中的圖標

[英]Icon in shiny/ shinydashboard

我的客戶希望我創建一個包含以下圖標的shinydashboard

在此處輸入圖片說明

有人知道類似的圖標嗎

或任何shiny / shiny shinydashboard中的東西,允許我在圓圈中間放置一個數字???

如果只是圖標,您將在這里找到它:

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

但是,如果您想在內部顯示一個數字,則可以使用純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文件:

#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