Skip to content

Wrong order for grouped bar chart sorting (descending) #4749

Closed as not planned

Description

@oshikryu

https://codepen.io/oshikryu/pen/xxwxzwm

I'm trying to create a grouped bar chart where the order has the aggregate total of a category going in descending order.

Screen Shot 2020-05-19 at 12 58 03 AM

Some notes explaining the chart:

  • cloudy should be before rainy when descending

Is there something wrong with the data I have formatted? Or is this a bug with the sorting logic inside of plotly itself?

Activity

  1. changed the title [-]Wrong order for grouped bar chart sorting (descending)[/-] [+]Wrong order for bar chart sorting with null values[/+] on Apr 22, 2020
  2. oshikryu commented on Apr 22, 2020

    @oshikryu
    ContributorAuthor

    It appears the base case is boiled down to null values improperly being sorted
    https://codepen.io/oshikryu/pen/MWaJgLx

  3. alexcjohnson commented on Apr 22, 2020

    @alexcjohnson
    Collaborator

    Nice detective work @oshikryu - that part is definitely a bug, we should probably do something like we do in dash-table and always sort null / invalid values at the end, regardless of sort order. I think though that your original use case can be solved without transforms, using categoryorder: 'total descending' https://plotly.com/javascript/reference/#layout-xaxis-categoryorder

  4. changed the title [-]Wrong order for bar chart sorting with null values[/-] [+]Wrong order for grouped bar chart sorting (descending)[/+] on Apr 22, 2020
  5. oshikryu commented on Apr 22, 2020

    @oshikryu
    ContributorAuthor

    I will open up a separate issue for the simple case of non-grouped bar chart sorting with null values. The original case of grouped bar sorting still remains unresolved

  6. oshikryu commented on May 19, 2020

    @oshikryu
    ContributorAuthor

    I've updated the example for a much simpler reproduction of the bug. I believe it's either malformed transform or something weird with sorting choosing the first target in a dataset

  7. oshikryu commented on May 19, 2020

    @oshikryu
    ContributorAuthor

    I believe this issue is related to #4711

  8. self-assigned this
    on Jun 17, 2024
  9. removed their assignment
    on Aug 2, 2024
  10. emilykl commented on Aug 27, 2026

    @emilykl
    Contributor

    Closing this issue because transforms was removed from the API in #7240.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions