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

What is the replacement for xVals for BarChartData? in swift 3.0 #1816

Closed
Aungbandlab opened this issue Nov 10, 2016 · 4 comments
Closed

What is the replacement for xVals for BarChartData? in swift 3.0 #1816

Aungbandlab opened this issue Nov 10, 2016 · 4 comments

Comments

@Aungbandlab
Copy link

BarChartData(xVals: dataPoints, dataSet: chartDataSet)

@Aungbandlab
Copy link
Author

found the way thanks

@fnk0
Copy link

fnk0 commented Nov 12, 2016

@Aungbandlab what is the way?

@diogoAntunes
Copy link

let labels = ["Label 1", "Label 2"]
chartView.xAxis.valueFormatter = DefaultAxisValueFormatter {
    return labels[Int($0)]
}

@Aungbandlab
Copy link
Author

Aungbandlab commented Dec 22, 2016

@fnk0

// MARK: axisFormatDelegate
extension StackBarChartCell: IValueFormatter {

func stringForValue(_ value: Double,
                    entry: ChartDataEntry,
                    dataSetIndex: Int,
                    viewPortHandler: ViewPortHandler?) -> String {
    return String(format: "%.0f", value)
}

}

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

3 participants