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

How to set multiple Stackbar with Charts 3 #1819

Closed
PreechaS opened this issue Nov 11, 2016 · 1 comment
Closed

How to set multiple Stackbar with Charts 3 #1819

PreechaS opened this issue Nov 11, 2016 · 1 comment

Comments

@PreechaS
Copy link

PreechaS commented Nov 11, 2016

#1801 I can't figure out how to do it in Charts 3.
It used to work well with the previous version of iOS-charts.(swift 2)

This is sample code and output so you may can tell me what is wrong.

    for i in 0..<12 {
        let value = Double(i)
        let attempt = BarChartDataEntry(x: value, y: value)
        attemptEntries.append(attempt)
        let result = BarChartDataEntry(x: value, yValues: [2*value, 3*value])
        resultEntries.append(result)
    }
    let attemptDataSet = BarChartDataSet(values: attemptEntries, label: Constants.Chart.TotalAttempt.Label)
    let resultDataSet = BarChartDataSet(values: resultEntries, label: Constants.Chart.Result.Label)

    let dataSets = [attemptDataSet, resultDataSet]
    let barData = BarChartData(dataSets: dataSets)

    chartView.data = barData

simulator screen shot nov 9 2559 be 3 02 09 pm

@liuxuan30
Copy link
Member

liuxuan30 commented Nov 11, 2016

Dup. #1801
Don't create dup issue. we will update if needed

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

2 participants