2016-05-04 6 views
2

Ich verwende IOS-Charts-Bibliothek (Ios Charts) für Graphen (Linie, Balken). Mein Problem ist, dass wenige Fälle Y-Achsen-Labels nicht angezeigt werden.IOS Charts Linke Achse zeigt keine Labels wenige Fälle

bitte helfen Sie mir, dies zu lösen.

hier, was mein Code

ChartYAxis *leftAxis = _barChartView.leftAxis; 
leftAxis.startAtZeroEnabled = YES; 
leftAxis.labelFont = [UIFont systemFontOfSize:10.f]; 
leftAxis.labelCount = 8; 
leftAxis.valueFormatter = [[NSNumberFormatter alloc] init]; 
leftAxis.valueFormatter.maximumFractionDigits = 1; 
leftAxis.axisLineColor = [UIColor blackColor]; 
leftAxis.axisLineWidth = 1.0; 

leftAxis.labelPosition = YAxisLabelPositionOutsideChart; 
leftAxis.spaceTop = 0.15; 

BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithYVals:yVals label:@"Legend"]; 

NSMutableArray *dataSets = [[NSMutableArray alloc] init]; 
[dataSets addObject:set1]; 

BarChartData *data = [[BarChartData alloc] initWithXVals:xvalues dataSets:dataSets]; 
[data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]]; 

_barChartView.leftAxis.startAtZeroEnabled = NO; 

_barChartView.data = data; 

Antwort

4

Das unten mein Problem gelöst.

leftAxis.labelCount = 5; 
leftAxis.forceLabelsEnabled = YES; 
Verwandte Themen