2011-04-21 53 views

回答

3

还没有传奇类。有时您可以使用图像来伪造它,但它不在Core Plot中。 Check drewmcco Comment

传说还没有在Core Plot中实现。您非常欢迎您将其实施到框架中。

与此同时,您可以使用UILabels和彩色线构建自定义UIView作为图形的图例,然后将其作为图形的同级添加(不是子视图,否则将无法正确呈现)并命令它在图表上方显示。 Check Brad Larson Answer

+0

请你解释一下如何将视图作为兄弟图添加到核图图 – ios 2011-04-21 09:21:05

+0

你不能添加图像作为图视图的子视图吗? – 2011-04-21 09:42:09

+0

感谢您的回复,Actualy我对coreplot更新,我对coreplot的流程还不是很清楚。所以你会指导我更多 – ios 2011-04-21 11:05:14

26

更新:CorePlot 0.4有类CPTLegend:

_graph.legend = [CPTLegend legendWithGraph:_graph]; 
_graph.legend.textStyle = x.titleTextStyle; 
_graph.legend.fill = [CPTFill fillWithColor:[CPTColor darkGrayColor]]; 
_graph.legend.borderLineStyle = x.axisLineStyle; 
_graph.legend.cornerRadius = 5.0; 
_graph.legend.swatchSize = CGSizeMake(25.0, 25.0); 
_graph.legendAnchor = CPTRectAnchorBottom; 
_graph.legendDisplacement = CGPointMake(0.0, 12.0); 

见CorePlot_0.4 /来源/例子/ CorePlotGallery/src目录/图/ SimpleScatterPlot.m。

+2

比接受的答案更好! tnx(+投票) – 2012-07-02 11:55:09

相关问题