对于下面的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
```
我想将图表的背景颜色设置为白色。
如果我编织它然后编辑 <style>
就可以做到这一点在生成的 figure/nvd3plot2.html
中阻止添加background-color: white;
:
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 400px;
background-color: white;
}
</style>
我如何从 .Rmd 文件执行此操作?
最佳答案
如我的评论所述,获得白色背景的快速修复方法是将以下行添加到您的 Rmd
文件
<style>iframe{background-color: white}</style>
关于css - 在 rCharts/slidify/nvd3 中设置图表区域背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21081469/