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

Labels to PieChart? v 3.0.2 #2323

Closed
jesus-rod opened this issue Apr 3, 2017 · 3 comments
Closed

Labels to PieChart? v 3.0.2 #2323

jesus-rod opened this issue Apr 3, 2017 · 3 comments

Comments

@jesus-rod
Copy link

I am using the latest Charts version after updating a project to Swift 3.1.
However, the dataset initializer not longer takes the labels as it did before

before:
let pieChartData = PieChartData.init(xVals: labels, dataSets: [dataSet])

now
let pieChartData = PieChartData.init(dataSets: [dataSet])

Reference to code/docs with the updated way to do this?

@abdallahnh
Copy link

Hi,

Try this:

let pieChartDataSet = PieChartDataSet(values: dataEntries, label: nil) let pieChartData = PieChartData(dataSets: [pieChartDataSet])

@jesus-rod
Copy link
Author

Still the question remains. Where Do I add the labels?

@jesus-rod
Copy link
Author

Ok this was hard to find out... In the newest version one should use:

let entry = PieChartDataEntry(value: Double(yourValue), label: label)

before, the initializer for any chart was ChartDataEntry which did not take the label parameter

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