Negative Bar animation is gone if axis.inverted=true
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Negative Bar animation is gone if `axis.inverted=true`
The issue is found while reviewing #3650
## What did you expect to happen?
negative bar animation should be fine when inverted is enabled
## Charts Environment
**Charts version/Branch/Commit Number:**
**Xcode version:** 10
**Swift version:** 4.2
**Platform(s) running Charts:** iOS
**macOS version running Xcode:** 10.14
## Demo Project
Just use below data set:
```swift
func setDataCount(_ count: Int, range: Double) {
let yVals = [
BarChartDataEntry(x: 0, y: -10),
BarChartDataEntry(x: 1, y: 20),
BarChartDataEntry(x: 2, y: -30),
BarChartDataEntry(x: 3, y: 15)
]
var set1: BarChartDataSet! = nil
```
and add a breakpoint or code
```swift
chartView.leftAxis.inverted = true // false
```
You will see the animation for pos. bars is fine, but the animation for neg. bars is gone if inverted = true. **animation for neg. bars is fine when inverted = false**

Contributor guide
Research direction
Start with the demo data in setDataCount and the chartView.leftAxis.inverted setting, then trace the bar animation behavior for negative and positive entries. Compare inverted=true with inverted=false and verify that negative bars animate when the axis is inverted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100