Skip to content

Sorting doesn't work if data for both axis is numeric #2881

Description

@kazimirchuk

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

Latest

Code Sandbox link

https://codesandbox.io/s/victory-starter-forked-l73jld?file=/src/App.tsx

Bug report

Sorting doesn't work if data for both axis is numeric.

Steps to reproduce

1. Go to a "Getting Started" page of Victory
2. Go to Step #3 "Add your data"
3. Confirm that chart data that you see follows this `interface { earnings: number; quarter: number }`
4. Try adding an attribute `sortKey` with the value of `earnings` to the `VictoryBar`
5. Confirm that it doesn't sort
6. Now edit chart data so that it follows this `interface { earnings: number; quarter: string }`
7. Confirm that it started sorting

Expected behavior

It should sort the data by specified `sortKey`

Actual behavior

It doesn't sort the data by specified `sortKey`

Environment

- Device:
- OS:
- Node:
- npm:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: AcceptedThe submitted issue has been confirmed by the Victory core teamType: Bug 🐛Oh no! A bug or unintentional behavior

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions