上下文
我想使用基于html 模板的高级 UI 创建一个 R Shiny 仪表板。因此,UI 是用纯 HTML 构建的,我使用Bootstrap 4 免费模板作为起点。
问题 虽然使用 highcharter 及其 Shiny 集成功能可以很好地处理超级基本的 HTML 文件(与上面的教程相同),但一旦我使用引导仪表板主题,图表就不会显示。
我已经尝试过的
可重现的示例
在这里共享可重现的示例很困难,因为您需要完整的 SB Admin 2 文件夹才能使其工作。基本上这不起作用:
# insert the following in my HTML template (index.html)
{{ highchartOutput("highcharter_plot") }}
Run Code Online (Sandbox Code Playgroud)
相应的可复制服务器部分:
# in server.R
output$highcharter_plot <- renderHighchart({
data(citytemp)
hc <- highchart() %>%
hc_xAxis(categories = citytemp$month) %>%
hc_add_series(name = "Tokyo", data = citytemp$tokyo) %>%
hc_add_series(name = "London", data = citytemp$london) %>%
hc_add_series(name = "Other …Run Code Online (Sandbox Code Playgroud)