简体   繁体   English

有没有办法改变dygraph标签的背景颜色?

[英]Is there a way to change background-color of dygraph labels?

When I place a dygraph on my website I want the background of the graph to match the background-color of my website.当我在我的网站上放置一个 dygraph 时,我希望图形的背景与我网站的背景颜色相匹配。 When I set the dygraph background color via css in the <div> tag attributes the color is not applied to the label, it remains white when I mouse over the data.当我通过<div>标签属性中的 css 设置 dygraph 背景颜色时,颜色不会应用于标签,当我将鼠标悬停在数据上时它保持白色。

<div id="graphdiv" style="width:750px; height:300px; background-color: lightblue;"></div>

If the option existed it would presumably be called labelsColor, but that option doesn't exist.如果该选项存在,它大概会被称为labelsColor,但该选项不存在。 Is there some other way to change the label color?还有其他方法可以更改标签颜色吗?

Not sure why you're having an issue with the color of the background as my graph div is in the body of my page and simply inherits the CSS background style of the page body.不知道为什么你的背景颜色有问题,因为我的图形 div 位于我的页面正文中,并且只是继承了页面正文的 CSS 背景样式。 As for the color of the legend, amongst other things, see http://dygraphs.com/css.html —I changed the color of the background of my legend using:至于图例的颜色,除其他外,请参见http://dygraphs.com/css.html —我使用以下方法更改了图例背景的颜色:

background: transparent !important;

in .dygraph-legend and it is now the color of the body of the page.在 .dygraph-legend 中,它现在是页面正文的颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM