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

Added ability to override maxValue for line and bar charts #3

Merged
merged 2 commits into from Jan 29, 2016

Conversation

EpicDraws
Copy link
Contributor

Setting maxValue overrides default behavior of using the highest value
as the max y value for the charts.

Setting maxValue overrides default behavior of using the highest value
as the max y value for the charts.
* The maximum value to use for the chart. Setting this will override the
* default behavior of using the highest value as maxValue.
*/
@property NSNumber* maxValue;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add (nonnull, nonatomic)?

I've added (nonatomic) declaration.
https://github.com/yasuoza/YOChartImageKit/blob/master/Source/YOChartImageKit/YOBarChartImage.h#L30

@yasuoza
Copy link
Owner

yasuoza commented Jan 29, 2016

When maxValue is a property, its getter should returns user defined value or max value of _values.

So, how about defining like this?

- (NSNumber *)getMaxValue {
    return _maxValue ? _maxValue : [NSNumber numberWithFloat:[[_values valueForKeyPath:@"@max.floatValue"] floatValue]];
}

@stuffmc
Copy link
Contributor

stuffmc commented Jan 29, 2016

Please oh please don't make a getXXX property. This isn't java ;) the getter should be (NSNumber *)maxValue — or did I misunderstand something?

@EpicDraws
Copy link
Contributor Author

Agreed, and submitted a change with nonnull, nonatomic as well as the
getter method using -maxValue.

On Fri, Jan 29, 2016 at 1:08 AM StuFF mc notifications@github.com wrote:

Please oh please don't make a getXXX property. This isn't java ;) the
getter should be (NSNumber *)maxValue — or did I misunderstand something?


Reply to this email directly or view it on GitHub
#3 (comment)
.

@yasuoza
Copy link
Owner

yasuoza commented Jan 29, 2016

@stuffmc Thank you for your whole contribution! Yes, I agree with you.

@EpicDraws Thank you very much! I'll merge this!

yasuoza added a commit that referenced this pull request Jan 29, 2016
Added ability to override maxValue for line and bar charts
@yasuoza yasuoza merged commit e2a3bd7 into yasuoza:master Jan 29, 2016
@yasuoza
Copy link
Owner

yasuoza commented Jan 29, 2016

I will release new version in this weekend. Thank you guys!

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

Successfully merging this pull request may close these issues.

None yet

3 participants