gpt4 book ai didi

ios - 如何在 TableView Cell 上使用 iOSCharts (https ://github. com/danielgindi/Charts)?

转载 作者:行者123 更新时间:2023-11-30 13:33:09 33 4
gpt4 key购买 nike

我想在表格单元格中使用水平条形图,因为每个单元格值都将动态分配。谢谢这是 cellForRowAtIndexPath 中的代码强文字

[ self 设置BarLineChartView: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];

最佳答案

//我们必须在TableView类中声明以下属性

@property(非原子,强)CampaignInfoCellTableViewCell *cell;

关于ios - 如何在 TableView Cell 上使用 iOSCharts (https ://github. com/danielgindi/Charts)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36352396/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com