我試圖在我的iOS應用中實施條形圖。我正在使用JBChartView。一切工作正常,但除了使用touchEvent按下它們時,酒吧沒有顏色。在JBChartView中不顯示條形圖的顏色
有沒有人有這個特定的插件的任何經驗,以幫助我得到它正常工作?
感謝
- (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;
}
作爲一個方面說明,我很驚訝,即使運行,因爲它看起來像'min = max'(又名所有高度相同),你應該得到一個「除以0」的錯誤。 – Stonz2
謝謝你的解釋它的工作原理......但奇怪的問題是最小值的酒吧不顯示..所以我不得不添加一個額外的酒吧,它必須設置0值... –