Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Add a legend to Core Plot in iPhone SDK?

How can I add Legends in Core Plot framework?

I am greatly appreciative of any guidance or help.

like image 301
ios Avatar asked Apr 21 '11 07:04

ios


1 Answers

Update: CorePlot 0.4 has the class 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);

See CorePlot_0.4/Source/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m.

like image 118
Colin Avatar answered Sep 29 '22 15:09

Colin