EDIT: I have a SVG graph produced with d3.js. The filled area of the graph is coloured by CSS rules. I would like the areas to be semi-transparent so that you can see data obscured by the foremost graph area.
Original:
Is there anyway to make the color of this graph transparent? http://jsfiddle.net/skys331/QBDGB/22/
I want to be able to see behind the green data.
Thanks
Yes. You can use transparent
for the fill, like so:
.line1 {
fill: transparent;
...
}
You can alternatively set the opacity of the .line1
element:
.line1 {
fill: green;
opacity: 0.5;
}
Or set the fill to us rgba
(RGB color with an alpha component):
.line1 {
fill: rgba(0, 128, 0, 0.5);
}
Add Opacity to the green:
.line1 {
fill: green;
stroke: black;
stroke-width: 1.5px;
opacity:0.5;
}
Edited your fiddle: http://jsfiddle.net/QBDGB/23/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With