[英]dygraphs change values/legend background
I'm using dygraphs on a dark background and can't seem to get the background on the legends/values to be transparent. 我在深色背景上使用dygraphs似乎无法使图例/值的背景透明。
CSS I've tried: CSS我试过:
.dygraph-legend {
background:none;
}
and 和
.dygraph-legend {
background-color: transparent;
}
I can't find a way to make this transparent. 我找不到让这个透明的方法。
dygraphs sets some inline styles on the legend <div
>. dygraphs在图例<div
>上设置一些内联样式。 To override them, you need to use !important
: 要覆盖它们,您需要使用!important
:
.dygraph-legend {
background: transparent !important;
}
Add another div right after the dyGraphs div and tell the graph to use this div for labels and style the labels div with the !important
annotation. 在dyGraphs div之后添加另一个div,并告诉图形将此div用于标签,并使用!important
注释设置标签div的样式。 Eg: 例如:
CSS: CSS:
.dyStatsLegend {
color: silver !important;
background: rgba( 255, 255, 255, 0.1 ) !important;
}
HTML: HTML:
<div id="dyGraphHumTemp" class="dyStatsDiv"></div>
<div id="dyGraphHumTempLabels" class="dyStatsLegend"></div>
JavaScript: JavaScript的:
var g1 = new Dygraph(
document.getElementById("dyGraphHumTemp"),
data,{
labelsDiv: 'dyGraphHumTempLabels'
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.