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

Formatter data on OS X #2141

Closed
thierryH91200 opened this issue Feb 6, 2017 · 1 comment
Closed

Formatter data on OS X #2141

thierryH91200 opened this issue Feb 6, 2017 · 1 comment

Comments

@thierryH91200
Copy link
Contributor

if i write

   let data = PieChartData()
    data.addDataSet(dataSet)

   let pFormatter = NumberFormatter()
    pFormatter.numberStyle = .percent
    pFormatter.maximumFractionDigits = 1
    pFormatter.multiplier = 1.0
    pFormatter.percentSymbol = " %"
    data.setValueFormatter(pFormatter )

i have an error
Cannot convert value of type 'NumberFormatter' to expected argument type 'IValueFormatter?'
Xcode offers

     data.setValueFormatter(pFormatter as! IValueFormatter )

and now the program crash

@thierryH91200
Copy link
Contributor Author

problem solved

    data.setValueFormatter(DefaultValueFormatter(formatter : pFormatter  ))

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