gpt4 book ai didi

iphone - iOS 应用程序中的气泡图

转载 作者:行者123 更新时间:2023-11-29 04:22:50 24 4
gpt4 key购买 nike

我需要在 iPad 应用程序中实现气泡图,每个气泡都具有用户交互(触摸事件)以导航到详细 View 。

是否有任何框架或方法可以做到这一点(例如使用 coreplot 的条形图、饼图、折线图)??

我尝试手动实现,甚至对每个气泡使用 CGContextRef,如下所示

CGContextRef c = UIGraphicsGetCurrentContext();
UIColor *grayColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];
[grayColor set];
CGRect rectangle = CGRectMake(xaxis+2,yaxis+2,size-4,size-4);
CGContextSetLineWidth(c,4);
CGContextStrokeEllipseInRect(c, rectangle);
CGContextAddEllipseInRect(c, rectangle);
CGContextSetFillColorWithColor(c, [bubbleColor CGColor]);
CGContextFillPath(c);

但无法从用户交互(即触摸事件)中裁剪边缘(因为这些气泡是 UIView 中内切的圆圈)。

提前致谢

最佳答案

您可以为此使用散点图。实现 -symbolForScatterPlot:recordIndex: 数据源方法,为每个绘图点提供自定义绘图符号。根据数据根据需要改变符号的大小、形状、填充等。

关于iphone - iOS 应用程序中的气泡图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12743643/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com