2017-06-19 96 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提醒自己。