【发布时间】:2014-02-24 12:04:00
【问题描述】:
我搜索了这个问题,但没有得到适当的答案。
我在我的应用程序中将 CorePlote 用于图形和图表。 我尝试将饼图图例自定义为圆形,但我没有找到任何方法或属性。
有人知道吗?
【问题讨论】:
-
你检查过这个 chttps://code.google.com/p/core-plot/issues/detail?id=90
我搜索了这个问题,但没有得到适当的答案。
我在我的应用程序中将 CorePlote 用于图形和图表。 我尝试将饼图图例自定义为圆形,但我没有找到任何方法或属性。
有人知道吗?
【问题讨论】:
您可以使用半径的cornerRadius属性。
请尝试以下代码,希望对您有所帮助。
theLegend.cornerRadius = [theLegend.bounds.size.width/2];
这里theLegend是CPTLegend的对象。
【讨论】:
这种方法帮助我制作了圆形图例项:
let size = CGSize(width: 20, height: 20)
theLegend.swatchSize = size
theLegend.swatchCornerRadius = size.height
【讨论】: