1

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

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

4

1 回答 1

3

如果您只是设置较小的文本样式,则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 论坛上对此进行了讨论

于 2012-08-23T03:23:48.710 回答