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 do I Use IValueFormatter to format XAxis labels in swift? #1676

Closed
Aftab301286 opened this issue Oct 18, 2016 · 5 comments
Closed

How do I Use IValueFormatter to format XAxis labels in swift? #1676

Aftab301286 opened this issue Oct 18, 2016 · 5 comments

Comments

@Aftab301286
Copy link

No description provided.

@Aftab301286 Aftab301286 changed the title How do I Use IValueFormatter in swift? How do I Use IValueFormatter to format XAxis labels in swift? Oct 18, 2016
@Aftab301286
Copy link
Author

I have 2 charts using valueformatters IAxisValueFormatter and IValueFormatter. Please tell me how I use these both formatters for the different charts in swift in the same class.

@Aftab301286
Copy link
Author

I am trying to use single formatter but since I have 2 charts in the same class the labels are getting overridden for the chart that is rendering data lastly. Hence, I am trying to use 2 formatters for the 2 charts but I am not getting the right code to use the same.

@danielgindi
Copy link
Collaborator

Either create separate formatter classes or use initWithBlock

@RobMans426
Copy link

Hi, Daniel
How are you?

Now I am using PieChart for my project.
Then I have one issue.

I have this error "Can not convert value of type NumberFormatter to expected argument type IValueFormatter?"

How can I solve this?
Here is snapshots of my code.
`
let currencyStyle = NumberFormatter()

self.currencyStyle.formatterBehavior = NumberFormatter.Behavior.behavior10_4
self.currencyStyle.numberStyle = NumberFormatter.Style.currency
self.currencyStyle.maximumFractionDigits = 0

....
let data = PieChartData(dataSets: iDataSet)
data.setValueFormatter(self.currencyStyle)

`

Please help me.

@Mukesh-kumar-sharma
Copy link

Please provide a correct solution before closing the tickets. I am facing huge problem while migrating from 2.3 to 3.0.1.

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

4 participants