Closed lapsus63 closed 7 years ago
I could make it work calling directly .shape("circle")
Here's a jsfiddle with the code from the website working, can you try it out there? I can't seem to reproduce the error you're talking about: https://jsfiddle.net/maL4L7ky/
@lapsus63 do you have any updates on this? Did the example help?
Closing this for now.
Hello, I can't manage to customize shape of my legend using your example. Here is my HTML:
<svg id="d3legend"></svg>
And my Javascript:var colorPalette = d3.scaleLinear().domain(steps).range(shades);
var legend = d3.legendColor()
.shape("path", d3.symbol().type(d3.symbolTriangle).size(150)) /* doesn't work */
.scale(colorPalette);
var svg = d3.select("#d3legend");
svg.empty();
svg.append("g")
.attr("class", "legend")
.attr("transform", "translate(20, 20)");
svg.select(".legend").call(window.legend);
Generated output: