I had a problem with y values in diverging barcharts. If dy == 0, it is converted as positive datapoints group. But 0 is neither positive nor negative. Therefore is group of negative datapoints, where value is 0, not more correct converted. I changed in your example some data values to 0 and you can see results: https://jsfiddle.net/oy21nzq0/1/ . Negative datapoints had in your example cherries and dates. You can see in console d3.stack() converted arrays for each group.
I.e. for cherries look likes this:
https://github.com/d3/d3-shape/blob/b8279d6b4914dac7799ef6953aac24e92c2b5dab/src/offset/diverging.js#L5
Hi,
I had a problem with y values in diverging barcharts. If dy == 0, it is converted as positive datapoints group. But 0 is neither positive nor negative. Therefore is group of negative datapoints, where value is 0, not more correct converted. I changed in your example some data values to 0 and you can see results: https://jsfiddle.net/oy21nzq0/1/ . Negative datapoints had in your example cherries and dates. You can see in console d3.stack() converted arrays for each group. I.e. for cherries look likes this:
how you see 0 and 2 are not correct. Both are positive. Correct is below:
I fixed this problem, where I changed d3.stackOffsetDiverging https://jsfiddle.net/oy21nzq0/ . Please Check this FIX and say, if it's a good solution.
Best Regards Davit