我正在尝试在我的 iOS 应用程序中实现条形图。我正在使用 JBChartView。一切正常,但除了我使用 touchEvent 按下它们时,条形图没有颜色。
有没有人对这个特定的插件有任何经验来帮助我让它正常工作?
谢谢
- (void)viewDidLoad
{
_barChartView = [[JBBarChartView alloc] init];
_barChartView.delegate = self;
_barChartView.dataSource = self;
_tableView.backgroundColor =[UIColor clearColor];
_barChartView.frame = CGRectMake(0,0,200,200);
_barChartView.backgroundColor = [UIColor clearColor];
[_barChartView reloadData];
[_barChart addSubview: _barChartView];
}
- (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView
{
return [UIColor greenColor]; // color of selection view
}
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu
{
return YES;
}
- (UIColor *)barChartView:(JBBarChartView *)barChartView colorForBarViewAtIndex:(NSUInteger)index
{
return [UIColor greenColor];
}
- (NSUInteger)numberOfBarsInBarChartView:(JBBarChartView *)barChartView
{
return 4;
}
- (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtAtIndex:(NSUInteger)index
{
return 100.0;
}