Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Bar chart with different number of bars in each set #4125

Open
rameezibrahim opened this issue Aug 28, 2019 · 0 comments
Open

Multiple Bar chart with different number of bars in each set #4125

rameezibrahim opened this issue Aug 28, 2019 · 0 comments

Comments

@rameezibrahim
Copy link

What did you do?

I have created my data set as follows.

Block:

let block: (Int) -> BarChartDataEntry = { (i) -> BarChartDataEntry in
          return BarChartDataEntry(x: Double(i), y: Double(arc4random_uniform(randomMultiplier)))
      }

For Loop

startYear = 0
endYear = 5
for i in 0..<4 {
            let yVals = (startYear ..< endYear).map(block)
            let set = BarChartDataSet(entries: yVals, label: "Company \(i)")

            colorIndex = colorIndex < colors.count ? colorIndex : 0
            set.setColor(colors[colorIndex])
            colorIndex += 1

            dataSetList.append(set)
        }

What did you expect to happen?

4 set's with 5 bar's in each set.

What happened instead?

Chart draws only 4 set's with 4 bar's in each set
IMG_32501769122E-1

Charts Environment

Charts version/Branch/Commit Number:
Xcode version: 10.2
Swift version: 5.0
Platform(s) running Charts: iPad - v11.3.1
macOS version running Xcode: 10.14.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant