Dygraphs change legend values ​​/ background

I am using dygraphs on a dark background and cannot imagine the legends / values ​​background being transparent.

CSS I've tried:

.dygraph-legend {
  background:none;
}

      

and

.dygraph-legend {
  background-color: transparent;
}

      

I cannot find a way to make this transparent.

Link to problem image: here

+3


source to share


2 answers


dygraphs sets some inline styles in legend <div

>. To override them you need to use !important

:



.dygraph-legend {
  background: transparent !important;
}

      

+4


source


Add another div just after the dyGraphs div and tell the graphic to use this div for labels and style the annotated divs !important

. For example:.

CSS

.dyStatsLegend {
color: silver !important;
background: rgba( 255, 255, 255, 0.1 ) !important;
}

      

HTML:



<div id="dyGraphHumTemp" class="dyStatsDiv"></div>
<div id="dyGraphHumTempLabels" class="dyStatsLegend"></div>

      

JavaScript:

var g1 = new Dygraph(
    document.getElementById("dyGraphHumTemp"),
    data,{
        labelsDiv: 'dyGraphHumTempLabels'
    });

      

0


source







All Articles