We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using stack bar chart view but when upgrade to Chart 3.0.0, i don't know how to update x value anymore
Here the code
NSMutableArray *yVals = [[NSMutableArray alloc] init]; for (int i = 0; i < 3; i++) { double mult = 4; double val1 = (double) (arc4random_uniform(mult) + mult / 3); double val2 = (double) (arc4random_uniform(mult) + mult / 3); double val3 = (double) (arc4random_uniform(mult) + mult / 3); [yVals addObject:[[BarChartDataEntry alloc] initWithX:i yValues:@[@(val1), @(val2), @(val3)]]]; } BarChartDataSet *set1 = nil; if (_chartView.data.dataSetCount > 0) { set1 = (BarChartDataSet *)_chartView.data.dataSets[0]; set1.values = yVals; [_chartView.data notifyDataChanged]; [_chartView notifyDataSetChanged]; } else { set1 = [[BarChartDataSet alloc] initWithValues:yVals label:@"Statistics Vienna 2014"]; set1.colors = @[ChartColorTemplates.material[0], ChartColorTemplates.material[1], ChartColorTemplates.material[2]]; set1.stackLabels = @[@"Births", @"Divorces", @"Marriages"]; NSMutableArray *dataSets = [[NSMutableArray alloc] init]; [dataSets addObject:set1]; NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; formatter.maximumFractionDigits = 1; formatter.negativeSuffix = @" $"; formatter.positiveSuffix = @" $"; BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets]; [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:7.f]]; [data setValueFormatter:[[ChartDefaultValueFormatter alloc] initWithFormatter:formatter]]; [data setValueTextColor:UIColor.whiteColor]; _chartView.fitBars = YES; _chartView.data = data; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using stack bar chart view but when upgrade to Chart 3.0.0, i don't know how to update x value anymore
Here the code
The text was updated successfully, but these errors were encountered: