Skip to content

Commit

Permalink
Merge pull request #1015 from liuxuan30/barBorderCrash
Browse files Browse the repository at this point in the history
Fix #1014: fix combined chart crash while toggle bar borders
  • Loading branch information
liuxuan30 committed May 10, 2016
2 parents c9717e8 + 78c66e7 commit ee28dc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ChartsDemo/Classes/DemoBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView

if ([key isEqualToString:@"toggleBarBorders"])
{
for (id<IBarChartDataSet> set in chartView.data.dataSets)
for (id<IBarChartDataSet, NSObject> set in chartView.data.dataSets)
{
set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0;
if ([set conformsToProtocol:@protocol(IBarChartDataSet)])
{
set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0;
}
}

[chartView setNeedsDisplay];
Expand Down

0 comments on commit ee28dc5

Please sign in to comment.