plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.16k stars 1.03k forks source link

Incorrect Ranking with Negative Values in Area Bump Chart #2196

Open thekevinbrown opened 1 year ago

thekevinbrown commented 1 year ago

Describe/explain the bug When using the Area Bump Chart, negative values are treated as positive values for the purposes of ranking.

To Reproduce

I created a sandbox here: https://codesandbox.io/s/nivo-line-line-color-442-forked-0zv35u?file=/src/index.js I'd expect company 2 in between company 1 and company 3 in that example.

Here's an example screenshot from our app: Screenshot 2022-12-08 at 6 22 52 pm

The red company goes negative at the end, while the Baseline row is always 0, but Baseline shows below the negative values.

Expected behavior I expected ranking to respect the negative values.

Additional context I can see that the width of the bar is bigger for negative rows. I think that's ok as long as the ranking takes into account the actual values (not the magnitude of the values).

In our use case we're trying to rank companies by Net Profit. Some companies lose money. These should not outrank companies that are breaking even.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

thekevinbrown commented 1 year ago

bump

stale[bot] commented 1 year ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

thekevinbrown commented 1 year ago

bump

thekevinbrown commented 1 year ago

bump

thekevinbrown commented 1 year ago

bump

thekevinbrown commented 8 months ago

bump