我的数据点在使用 JBLineChartView 时遇到问题。主要是;图表上的线是隐藏的,直到(并且仅在)用户与其交互时。明显地; 出于用户体验的原因,这里有一个空图不太理想,但我似乎无法找到在用户与其交互之前将其设置为隐藏线的位置。
即使在浏览了提供的演示之后,我也找不到调用它的位置。以下是处理视图中图表的绘制和设置的代码:
- (void)viewDidLoad
{
self.title = @"Water Quality";
_chartView = [[JBLineChartView alloc] init];
_chartView.delegate = self;
_chartView.dataSource = self;
[_chartView setState:JBChartViewStateExpanded];
_chartView.backgroundColor = [UIColor blackColor];
_chartView.showsLineSelection = YES;
_chartView.showsVerticalSelection = YES;
[_chartView setAlpha:0.5f];
_headerView = [[JBChartHeaderView alloc] initWithFrame:CGRectMake(0, 74, 320, 30)];
_chartView.frame = CGRectMake(0, 94, 320, 200);
_footerView = [[JBLineChartFooterView alloc] initWithFrame:CGRectMake(0, 294, 320, 30)];
_headerView.titleLabel.text = @"Alkalinity";
_headerView.titleLabel.textColor = [UIColor whiteColor];
_footerView.leftLabel.text = [testArray1 firstObject];
_footerView.rightLabel.text = [testArray1 lastObject];
_footerView.leftLabel.textColor = [UIColor whiteColor];
_footerView.rightLabel.textColor = [UIColor whiteColor];
_footerView.backgroundColor = [UIColor blackColor];
[_footerView setAlpha:0.5f];
_footerView.sectionCount = [testArray1 count];
// THIS IS THE VIEW WHEN THE USER INTERACTS WITH THE CHART
/*
_informationView = [[JBChartInformationView alloc] initWithFrame:CGRectMake(0, 0, 40, 300)];
[_informationView setBackgroundColor:[UIColor grayColor]];*/
[_chartView setMinimumValue:1.0f];
[_chartView setMaximumValue:20.0f];
[self.view addSubview:_footerView];
[self.view addSubview:_headerView];
[self.view addSubview:_chartView];
// [self.view addSubview:_informationView];
[_chartView reloadData];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
我意识到这有点晦涩难懂。但是有没有人有这个框架的经验可以解释这一点?