Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 更改核心图中图例的大小?_Objective C_Macos_Cocoa_Core Plot - Fatal编程技术网

Objective c 更改核心图中图例的大小?

Objective c 更改核心图中图例的大小?,objective-c,macos,cocoa,core-plot,Objective C,Macos,Cocoa,Core Plot,我有一个带有相应图例的饼图。如何更改图例框的大小?(缩小所有内容,包括文本、颜色框和框架) 注意:我正在为OSX而不是iOS构建应用程序。如果您只需设置一个较小的文本样式CPTLegend,所有内容都将根据请求调整大小。因此,对于您的CPTGraph,您需要执行以下操作: CPMutableTTextStyle *mySmallerTextStyle = [[[CPTMutableTextStyle alloc] init] autorelease]; [textStyle setFontNam

我有一个带有相应图例的饼图。如何更改图例框的大小?(缩小所有内容,包括文本、颜色框和框架)


注意:我正在为OSX而不是iOS构建应用程序。

如果您只需设置一个较小的文本样式
CPTLegend
,所有内容都将根据请求调整大小。因此,对于您的
CPTGraph
,您需要执行以下操作:

CPMutableTTextStyle *mySmallerTextStyle = [[[CPTMutableTextStyle alloc] init] autorelease];
[textStyle setFontName:fontName];
[textStyle setColor:color];

//This is the important property for your needs
[textStyle setFontSize:5];

//Set this up with your graph
[graph setLegend:[CPTLegend legendWithGraph:graph]];
[[graph legend] setTextStyle:(CPTTextStyle *)mySmallerTextStyle];
在CorePlot论坛上有关于这一点的讨论