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 change value double to value int format? #2586

Closed
balkarov opened this issue Jul 8, 2017 · 1 comment
Closed

How change value double to value int format? #2586

balkarov opened this issue Jul 8, 2017 · 1 comment

Comments

@balkarov
Copy link

balkarov commented Jul 8, 2017

Hello!

Thank you for your amazing library!

How change double format to int format in all data values?

float

@balkarov
Copy link
Author

balkarov commented Jul 10, 2017

I solved my problem
#2473

Thanks @wadheraswati

set1 = [[LineChartDataSet alloc] initWithValues:values label:@""];
set1.valueFormatter = [[SetValueFormatter alloc] init];

In SetValueFormatter

@interface SetValueFormatter : NSObject <IChartValueFormatter>
@implementation SetValueFormatter

- (NSString * _Nonnull)stringForValue:(double)value entry:(ChartDataEntry * _Nonnull)entry dataSetIndex:(NSInteger)dataSetIndex viewPortHandler:(ChartViewPortHandler * _Nullable)viewPortHandler {
    return [NSString stringWithFormat:@"%d",(int)entry.y];
}

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