我有很多legend.can的條目請幫助使CPTLegend
滾動嗎?如何在CorePlot的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);
}