Core Plot Bar - Legend for just a few bars

155 Views Asked by At

I have one Bar Plot. This bar graph has ten bars but I just want to present the caption of only first 3 bars.

I even tried adding in an NSArray assistant the first three plot but without success.

Some help? idea? criticizes?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Implement one of the following methods in your datasource:

-(NSString *)legendTitleForBarPlot:(CPTBarPlot *)barPlot
                       recordIndex:(NSUInteger)idx;
-(NSAttributedString *)attributedLegendTitleForBarPlot:(CPTBarPlot *)barPlot
                                           recordIndex:(NSUInteger)idx;

Return a title for the bar index if you want it to appear in the legend or nil to exclude that bar from the legend.