Skip to content

Incorrect Ranking with Negative Values in Area Bump Chart #2196

@thekevinbrown

Description

@thekevinbrown

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions