在 dashboardHeader 中添加图片
Add picture in dashboardHeader
我的 R shiny 应用程序需要您的帮助。我想在 dashboardHeader
的标题附近添加一个 logo
。徽标不显示在页面中。你能帮助我吗 ?提前致谢。
这是代码:
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPage(
dashboardHeader(title = tags$img(src='logo.JPG', height = '60', width ='60')),
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) {}
)
您的代码似乎工作正常。尝试使用来自互联网的图像(我只是以 google 为例)。
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPage(
dashboardHeader(title = tags$img(src='https://cdn.vox-cdn.com/thumbor/Ous3VQj1sn4tvb3H13rIu8eGoZs=/0x0:2012x1341/1400x788/filters:focal(0x0:2012x1341):format(jpeg)/cdn.vox-cdn.com/uploads/chorus_image/image/47070706/google2.0.0.jpg', height = '60', width ='60')),
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) {}
)
只需在与您的脚本相同的目录中创建一个名为“www”的新文件夹,并在其中添加您的图片
我的 R shiny 应用程序需要您的帮助。我想在 dashboardHeader
的标题附近添加一个 logo
。徽标不显示在页面中。你能帮助我吗 ?提前致谢。
这是代码:
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPage(
dashboardHeader(title = tags$img(src='logo.JPG', height = '60', width ='60')),
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) {}
)
您的代码似乎工作正常。尝试使用来自互联网的图像(我只是以 google 为例)。
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPage(
dashboardHeader(title = tags$img(src='https://cdn.vox-cdn.com/thumbor/Ous3VQj1sn4tvb3H13rIu8eGoZs=/0x0:2012x1341/1400x788/filters:focal(0x0:2012x1341):format(jpeg)/cdn.vox-cdn.com/uploads/chorus_image/image/47070706/google2.0.0.jpg', height = '60', width ='60')),
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) {}
)
只需在与您的脚本相同的目录中创建一个名为“www”的新文件夹,并在其中添加您的图片