CPTLegend frame

132 views
Skip to first unread message

Surendra Kumar

unread,
May 18, 2012, 6:45:34 PM5/18/12
to coreplot-discuss
How to set the CPTLegend frame means display CPTLegend for user's x, y
and width, height

CPTLegend *theLegend = [[CPTLegend
alloc]initWithFrame:CGRectMake(200, 400, 800, 100)];

does not work

Eric

unread,
May 18, 2012, 7:29:37 PM5/18/12
to coreplot...@googlegroups.com
The legend frame fits tightly around the legend entries. You can add padding to the legend to put some space between the edge of the legend and the entries. You can also control the amount of space between rows and columns of legend entries. To position the legend, you can use the legend property of the graph to attach it to the graph. Use an annotation (either plot space or layer) and make the legend its contentLayer to position the legend somewhere else. There are demonstrations of both techniques in the Plot Gallery example app.

Eric
Reply all
Reply to author
Forward
0 new messages