ChartsOrg / ChartsOrg/Charts

Negative Bar animation is gone if axis.inverted=true

Open
#3,666 0 comments 0 reactions 0 assignees View on GitHub
bug
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**
![screen-recording-2018-09-29-at-9 39 52-am](https://user-images.githubusercontent.com/4375169/46239558-88c29b80-c3cc-11e8-8d46-909934861fc4.gif)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.