如何更改核心图堆积条形图中的图例标题?

时间:2015-11-24 09:03:11

标签: ios charts core-plot legend

How to show bar values on CorePlot -Stacked bar chart

关于这篇文章,我想更改叠加条形图的图例标题值,默认情况下需要"设置"代码中给出的值。 我无法改变"套装"值因为我使用它来匹配并从Web服务获取值。

enter image description here

上图而不是" D"," O"," P",我需要给出含义全名。 我在coloredBarChart中尝试了这样的代码,

-(NSString *)legendTitleForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index

{
    return [NSString stringWithFormat:@"Bar %lu", (unsigned long)(index + 1)];
}

然后它看起来如下,它取图中所有堆积条的索引值。

enter image description here

如何更改核心图中的图例标题值?

1 个答案:

答案 0 :(得分:0)

设置每个绘图的title属性以更改图例中显示的标签。如果要在标签中显示样式文本,可以使用attributedTitle

相关问题