css - 在 rCharts/slidify/nvd3 中设置图表区域背景颜色

标签 css nvd3.js rcharts slidify

对于下面的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/

相关文章:

javascript - 在 CSS 中保持鼠标焦点

javascript - CSS 转换后的对象位置修复

javascript - NVD3 - 如何刷新数据功能以在点击时生成新数据

javascript - nvd3 折线图未绘制正确的数据

javascript - Bootstrap 轮播中的 NVD3 图表

r - 更改 R 中 rCharts sankey 图中节点的颜色

jquery - Fadein, Fadeout 事件一起使用 jquery

jquery - 如何以我想要的方式在 jQuery 中使用 "attr()"?

rCharts 与 Shiny 0.8.0.99 一起使用时显示的功能有限

R在R 3.4.2 x64上安装rCharts