我有很多关于传奇的条目。有人可以帮忙制作CPTLegend
可滚动的吗?
这是我使用的代码CPTLegend
。
-(void)configureLegend {
// 1 - Get graph instance
CPTGraph *graph = self.hostView.hostedGraph;
// 2 - Create legend
CPTLegend *theLegend = [CPTLegend legendWithGraph:graph];
// 3 - Configure legen
theLegend.numberOfColumns = 1;
theLegend.fill = [CPTFill fillWithColor:[CPTColor clearColor]];
theLegend.borderLineStyle = [CPTLineStyle lineStyle];
theLegend.cornerRadius = 2.0;
// 4 - Add legend to graph
graph.legend = theLegend;
graph.legendAnchor = CPTRectAnchorBottom;
CGFloat legendPadding = -(self.view.bounds.size.width / 3);
graph.legendDisplacement = CGPointMake(-80, 120.0);
}