2017-06-19 92 views
1

我试图在popover中显示sparkline。我正在使用rmarkdown来创建我的html文档。rmarkdown - 将sparkline嵌入bootstrap popover

这里是我的尝试:

--- 
title: "test_embed_popup" 
author: "me" 
date: "16 June 2017" 
output: html_document 
--- 

```{r} 
library(sparkline) 
library(htmltools) 
library(bsplus) 

bsplus::use_bs_popover() 

button_content <- 
    spk_chr(c(1:5)) 

tags$button(type = "button", class = "btn btn-default", "A button") %>% 
    bs_embed_popover(title = "I'm a popover", content = button_content, html = "true") %>% 
    sparkline::spk_add_deps() 
``` 

当我编这个文件,用酥料饼的按钮但是没有出现火花是在酥料饼。我想在popover中显示sparkline。

任何帮助非常感谢。

回答

0

我已经摆弄了一下 - 我认为底层的问题是JavaScript没有被执行。这是这里讨论:

Execute JS inside of a Bootstrap popover

我想提出的解决方案可能是(至少目前如此),超出范围的bsplus - 但我已经做了一个issue提醒自己。