Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用折线图 PNLineChart 当只有一个数据的时候,点击折线图,直接崩溃。 #432

Open
lili-shangshu opened this issue Mar 29, 2018 · 0 comments

Comments

@lili-shangshu
Copy link

lili-shangshu commented Mar 29, 2018

设置 PNLineChartData 的数据中,只有一个数据,也就是折线图只显示一个点。点击屏幕,程序直接崩了。崩溃在,- (void)touchPoint:(NSSet *)touches withEvent:(UIEvent *)event 这个方法。

NSArray * data01Array = @[@13.1];
PNLineChartData *data01 = [PNLineChartData new];
data01.color = PNFreshGreen;
data01.inflexionPointStyle = PNLineChartPointStyleCircle;
data01.inflexionPointColor = [UIColor yellowColor];
data01.itemCount = data01Array.count;
data01.getData = ^(NSUInteger index) {
    CGFloat yValue = [data01Array[index] floatValue];
    return [PNLineChartDataItem dataItemWithY:yValue];
};

lineChart.chartData = @[data01];
[lineChart strokeChart];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant