Вопрос

For the following slidify deck,

---
title       : Foo
framework   : revealjs        # {io2012, html5slides, shower, dzslides, ...}
revealjs    : {theme: solarized}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      # 
widgets     : []            # {mathjax, quiz, bootstrap}
mode        : selfcontained # {standalone, draft}
ext_widgets : [libraries/nvd3]
---
## NVD3 Plot Iframe
```{r nvd3plot2, results = 'asis', comment = NA, message = F, echo = F} 
require(rCharts)
n1 <- nPlot(mpg ~ wt, data = mtcars, type = 'scatterChart')
n1
```

I want to set the background color of the chart to white.

I can do this if I knit it and then edit the <style> block in the generated figure/nvd3plot2.html to add background-color: white;:

<style>
.rChart {
  display: block;
  margin-left: auto; 
  margin-right: auto;
  width: 800px;
  height: 400px;
  background-color: white;
}  
</style>

How do I do this from the .Rmd file?

Это было полезно?

Решение

As indicated in my comment, a quick fix to get a white background is to add the following lines to your Rmd file

<style>iframe{background-color: white}</style>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top