For PieCharts, there are often several “slices” with a very small fraction of the data (for example, 2%, for example), and as a result, the labels overlap and are not read, as shown below. Does anyone know of this solution? I saw several diagrams that show a label outside the pie and point to the corresponding fragment, but I'm not sure if something like this is possible for ios diagrams.

A similar problem arises for histograms in which all values overlap and become unreadable, as shown below. The solution I can think of would be to display only a subset of the bars and show other columns if the user clicks.

If anyone is dealing with any problem, I would be glad to see how you solved it, or it is better to use another library. I have posted the code below, but am not sure if it will help, as this is apparently not an implementation error.
Chart table
//...init view... _chartView.delegate = self; _chartView.descriptionText = @""; _chartView.noDataTextDescription = @"No data"; _chartView.drawHighlightArrowEnabled = true; _chartView.drawValueAboveBarEnabled = YES; _chartView.drawMarkers = true; _chartView.dragEnabled = true; ChartXAxis *xAxis = _chartView.xAxis; xAxis.labelPosition = XAxisLabelPositionBottom; xAxis.labelFont = [UIFont systemFontOfSize:10.f]; xAxis.drawGridLinesEnabled = NO; xAxis.spaceBetweenLabels = 2.0; ChartYAxis *rightAxis = _chartView.rightAxis; rightAxis.enabled = NO; NSMutableArray *yVals = [[NSMutableArray alloc] init]; NSMutableArray *xVals = [[NSMutableArray alloc] init]; //populate xVals and yVals with data.. BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithYVals:yVals label:@"Occurences"]; set1.colors = ChartColorTemplates.vordiplom; set1.drawValuesEnabled = YES; NSMutableArray *dataSets = [[NSMutableArray alloc] init]; [dataSets addObject:set1]; BarChartData *bdata = [[BarChartData alloc] initWithXVals:xVals dataSets:dataSets]; [bdata setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]]; _chartView.data = bdata; [self.view addSubview:_chartView];
Pie chart
// init pie chart .. _pieChart.delegate = self;
_pieChart.usePercentValuesEnabled = YES; _pieChart.descriptionText = @""; _pieChart.drawCenterTextEnabled = YES; NSMutableArray *yVals = [[NSMutableArray alloc] init]; NSMutableArray *xVals = [[NSMutableArray alloc] init];
Mahir source share