Я хочу использовать горизонтальные гистограммы в ячейке таблицы: для каждой ячейки значение должно распределяться динамически.
Это код в cellForRowAtIndexPath
[self setupBarLineChartView:cell.chartView];
cell.chartView.delegate = self;
cell.chartView.drawBarShadowEnabled = NO;
cell.chartView.drawValueAboveBarEnabled = YES;
cell.chartView.maxVisibleValueCount = 60;
ChartXAxis *xAxis = cell.chartView.xAxis;
xAxis.labelPosition = XAxisLabelPositionBottom;
xAxis.labelFont = [UIFont systemFontOfSize:10.f];
xAxis.drawAxisLineEnabled = YES;
xAxis.drawGridLinesEnabled = YES;
xAxis.gridLineWidth = .3;
ChartYAxis *leftAxis = cell.chartView.leftAxis;
leftAxis.labelFont = [UIFont systemFontOfSize:10.f];
leftAxis.drawAxisLineEnabled = YES;
leftAxis.drawGridLinesEnabled = YES;
leftAxis.gridLineWidth = .3;
leftAxis.axisMinValue = 0.0; // this replaces startAtZero = YES
ChartYAxis *rightAxis = cell.chartView.rightAxis;
rightAxis.enabled = YES;
rightAxis.labelFont = [UIFont systemFontOfSize:10.f];
rightAxis.drawAxisLineEnabled = YES;
rightAxis.drawGridLinesEnabled = NO;
rightAxis.axisMinValue = 0.0; // this replaces startAtZero = YES
cell.chartView.legend.position = ChartLegendPositionBelowChartLeft;
cell.chartView.legend.form = ChartLegendFormSquare;
cell.chartView.legend.formSize = 8.0;
cell.chartView.legend.font = [UIFont fontWithName:@"HelveticaNeue-Light"
size:11.f];
cell.chartView.legend.xEntrySpace = 4.0;
_sliderX.value = 11.0;
_sliderY.value = 50.0;
[self slidersValueChanged:nil];
[cell.chartView animateWithYAxisDuration:2.5];
Подробнее здесь: https://stackoverflow.com/questions/363 ... eview-cell