Skip to content

Horizontal bar charts display with reversed axis direction (max → min instead of min → max) starting from Victory v35.0.0. #3074

@Surya-pratap-GL

Description

@Surya-pratap-GL

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

35.2.0

Code Sandbox link

No response

Bug report

## Bug Description
Horizontal bar charts display with reversed axis direction (max → min instead of min → max) starting from Victory v35.0.0.

## Environment
- **Victory version:** 37.3.6 (issue also present in 35.0.0 - 37.x)
- **React version:** 16.13.1
- **Previous working version:** 34.3.4

## Expected Behavior
Horizontal bar chart should display axis from **0 → 6000** (left to right):

Steps to reproduce

## Steps to Reproduce

<VictoryChart
  domain={{ y: [0, 1] }}
  padding={{ top: 50, bottom: 70, left: 60, right: 50 }}
>
  <VictoryAxis
    orientation="left"
    tickValues={[0, 0.083, 0.166, ..., 1]}
    tickFormat={["0", "500", "1,000", ..., "6,000"]}
  />
  <VictoryAxis
    orientation="bottom"
    tickFormat={["Total"]}
  />
  <VictoryBar
    horizontal
    data={[{ x: "Total", y: 0.9445 }]} // 5667 normalized to 0-1 scale
  />
</VictoryChart>

Expected behavior

Horizontal bar chart should display axis from **0 → 6000** (left to right) :
 [Bar]-------------------> 0 1000 2000 6000

Actual behavior

## Actual Behavior
Horizontal bar chart displays axis from **6000 → 0** (left to right):
## Console output
tickFormat: ["0", "500", "1,000", ..., "6,000"]  ✓ Ascending
tickValues: [0, 0.083, 0.166, ..., 1]             ✓ Ascending
bar y: 0.9445                                      ✓ Correct position
But visual displays: 6,000 on left, 0 on right

Environment

- Device:MAC 
- OS:
- Node:22
- npm:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug 🐛Oh no! A bug or unintentional behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions