如何删除nvd3.js中的背景网格线? [英] How do you remove the background gridlines in nvd3.js?
问题描述
我在nvd3.js中创建一个条形图,类似于此示例: http:// nvd3。 org / ghpages / discreteBar.html 。我想知道是否有一种方法来删除网格线,所以背景将是纯白色的。所有示例都使用网格线。我也检查了源代码,没有看到在discreteBar模型中的任何东西,这将使这一点成为可能。
I am making a bar graph in nvd3.js, similar to this example: http://nvd3.org/ghpages/discreteBar.html. I was wondering if there was a way to remove the gridline so the background would be plain white. All of the examples use gridlines. I also checked the source code and didn't see anything in the discreteBar model that would make this possible.
推荐答案
您可以在CSS中选择这些网格线并设置它们的不透明度0:
You can select those grid lines in your CSS and set their opacity 0:
.tick {
opacity: 0;
}
如果您仍想查看基线,可以将其修改为: / p>
If you still want to see the baseline, you could modify this to:
.tick:not(.zero) {
opacity: 0;
}
使用浏览器的检查器工具查看各个元素修改和使用CSS的力量。
Use your browser's inspector tools to see what class the individual elements have that you want to modify and use the power of CSS.
这篇关于如何删除nvd3.js中的背景网格线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!