Victory: sortKey param doesn't reorder bars on a horizontal bar chart, only labels

Created on 6 Aug 2018  路  6Comments  路  Source: FormidableLabs/victory

Bugs and Questions

Checklist

  • [x] This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • [x] I have read through the FAQ and Guides before asking a question

  • [x] I am using the latest version of Victory

  • [x] I've searched open issues to make sure I'm not opening a duplicate issue

The Problem

I want to display the bars in my chart in a specific order, so I added a sort key to the data source and passed the sortKey="sort" param to my VictoryBar component. This works as expected in the default vertical bar graph.

When I add the horizontal={true} param to the VictoryBar component, the sorting breaks. The labels on the independent axis are re-ordered correctly, but the bars stay in the same order no matter what.

Reproduction

https://codesandbox.io/s/6y3zno0m7k

Note: Sizing/spacing doesn't affect the issue, it's just so the graphs are easier to see. The only difference between the vertical graphs and horizontal graphs is the horizontal={true} parameter.

bug

Most helpful comment

@ryangiglio thank you for your patience. This work will be released on Friday :)

All 6 comments

@ryangiglio thank you for the helpful reproduction. I'll try to get this fixed for next week's release

Any update on when this will be fixed?

@ryangiglio sorry this got pushed back. I will get it out this week

No problem I appreciate that you're looking at it!

@ryangiglio thank you for your patience. This work will be released on Friday :)

This fix was released in [email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tgoldenberg picture tgoldenberg  路  5Comments

tylermassey picture tylermassey  路  5Comments

danielberndt picture danielberndt  路  4Comments

seddonm1 picture seddonm1  路  5Comments

icd2k3 picture icd2k3  路  3Comments