Open justUmen opened 2 years ago
On the page https://www.d3-graph-gallery.com/graph/pie_basic.html I think the code v6 should be : .attr('fill', function(d){ return(color(d.data)) }) and not .attr('fill', function(d){ return(color(d.data[1])) }).
.attr('fill', function(d){ return(color(d.data)) })
.attr('fill', function(d){ return(color(d.data[1])) })
Otherwise, it isn't identical to the code for v4.
Example with different values : (messed up colors if numbers are similar) v4 - https://jsfiddle.net/jnve0fb9/ v6 - https://jsfiddle.net/z2jcwf3x/
I used your page for migrating to v6, but this details got me confused for a while.
On the page https://www.d3-graph-gallery.com/graph/pie_basic.html I think the code v6 should be :
.attr('fill', function(d){ return(color(d.data)) })
and not.attr('fill', function(d){ return(color(d.data[1])) })
.Otherwise, it isn't identical to the code for v4.
Example with different values : (messed up colors if numbers are similar) v4 - https://jsfiddle.net/jnve0fb9/ v6 - https://jsfiddle.net/z2jcwf3x/
I used your page for migrating to v6, but this details got me confused for a while.