0

I need to implement bubble chart in an iPad application with each bubble having user interaction (touch event) to navigate to a detailed view.

Is there any framework or a way to do so (like bargraph, piechart, linegraph using coreplot)??

I tried implementing manually even using CGContextRef for each bubble as below

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);

but unable to crop the edges from having user interaction i.e, touch event (since these bubbles are circles inscribed in UIView's).

Thanks in Advance

2 Answers2

1

You can use a scatter plot for this. Implement the -symbolForScatterPlot:recordIndex: datasource method to provide a custom plot symbol for each plot point. Vary the size, shape, fill, etc., of the symbols as desired based on the data.

Eric Skroch
  • 27,381
  • 3
  • 29
  • 36
  • Hi Eric, Thanks for your support. But even -symbolForScatterPlot:recordIndex: is unable to recogize the edges. I mean the same issue is repeating there aswell. – Harsha Vardhan Pabbineedi Oct 08 '12 at 14:30
  • The `plotSymbolMarginForHitDetection` controls the hit tolerance. Unfortunately, the same value applies to the whole plot so you can't use a small value for small bubbles and a larger value for large bubbles. – Eric Skroch Oct 08 '12 at 22:36
0

Try this and this. Also, you could try OBShapedButton with your images. Hope this helps :)

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29