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

Feature/add format option #162

Open
wants to merge 5 commits into
base: new-version
Choose a base branch
from

Conversation

joaoGMPereira
Copy link

Add ChartLabelFormat

Description

Add format enum, that you could set a custom format to titleLabel

Motivation and Context

I thought in this change, because some cases we need to show number with currency format

How Has This Been Tested?

I created 2 scenarios with custom format and none format, in custom format, I tested formatting number and return with text format, in none format, I tested if stay like was before.

Screenshots (if appropriate):

Simulator Screen Shot - iPhone SE (2nd generation) - 2020-08-23 at 19 54 33

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (Updating Documentation, CI automation, etc..)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@joaoGMPereira
Copy link
Author

Hey @AppPear how are you? I created this pr, with some improvement in how we could format value, Is my first pr, so if you have other ideia let me know.

Sorry for my english kkk..

@joaoGMPereira
Copy link
Author

an example of how implements custom format:
CardView {
ChartLabel("Total", type: .subTitle, format: .custom(completion: { (value) -> String in
return "Total: (value.currencyFormat())"
}))
BarChart()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants