2

I want to set a custom uiview with label outlets in my graph, if a plot symbol was pressed, using the scatterPlot:plotSymbolWasSelectedAtRecordIndex: method.

But how can I give the plot area the UIView or how can I override CPTLayer to draw my custom UIView?

Thank you

4

1 回答 1

5

CPTLayer是 的子类CALayer,因此您不能只将自定义UIView用作 Core Plot 注释。但是,您可以将自定义视图作为 Core Plot 托管视图的同级插入(而不是子视图!)。使用绘图空间获取绘图区域中被触摸数据点的坐标,并使用内置CALayer方法将坐标从绘图区域图层转换为图形图层。

于 2013-05-01T00:55:59.403 回答