iOS7 not legend shown



Under iOS 6 and bellow and iOS7, my piecharts present fine and correctly. The problem is that under iOS7 there is no legend under the piechart, there is only the border of the legend, but no legend is inside. Something interesting is that the border of the legend’s frame is very small compared to the frame when its correctly displayed. Any ideas or tweak ?.




Hi Gustavo,

When I run the PieChart sample packaged with the framework my legend displays as expected. Could you provide your chart & legend setup code? I’ll try and replicate the issue on my end.



Hello Jan.

Here is the code:


    SChartTheme * theme = [SChartMidnightThemenew];
     theme.chartStyle.backgroundColor = [UIColorclearColor];
     theme.chartStyle.backgroundColorGradient = [UIColorclearColor];
     theme.chartStyle.borderColor = [UIColorclearColor];
     [(SChartMidnightTheme *)theme setMidnight_greyColorLowAlpha:[UIColorclearColor]];
    [(SChartMidnightTheme *)theme setMidnight_greyColor:[UIColor clearColor]];
    [theme.legendStyle setBorderColor:[UIColor lightGrayColor]];
    [theme.legendStyle setCornerRadius:[NSNumber numberWithDouble:3.0f]];


    self.pieChart.legend.hidden = NO;
     self.pieChart.autoresizingMask = ~UIViewAutoresizingNone;    
     UITapGestureRecognizer *tap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(legendClick:)];
     self.pieChart.legend.autosizeLabels = YES; = [UIFontfontWithName:@"HelverticaNeue-Light"size:12];
     self.pieChart.legend.position = SChartLegendPositionBottomMiddle;
 I dunno if that gesture recognizer has something to do with the problem.
 The tap gesture recognizer was implementeing acording a blog your have to add user interactivity to the legend.


Hi Gustav,

You have a typo in the line that sets the font on the pieChart. Try replacing @“Helve r ticaNeue-Light” with @“HelveticalNeue-Light” as currently you are assigning a nil font to your legend. (Nil is the return value when a font doesn’t exist.)

We use the font to calculate the size that the legend needs to be and the nil font is messing up these calculations. The chart’s legend should probably fall back to a default font if a nil font is set on it, so I’ve raised this as an issue!



Im an idiot! .:stuck_out_tongue:

Thanks for the remark.


No problem. Glad I could help!


Hi there 

I’m trying to show the legend on my bar chart but only the border is shown.


This is my code 

intraix%20%E2%80%94%20UtilitiesDashboardTableViewController.m Love to get some advise here :smiley: Thank you


Hi there :slight_smile:

anyone to advise on the legend moving way out of the plot area?

Thank you 


bumped  :scream: :scream: :scream:


Hi bosslee,

Sorry to hear you’re having this issue! I can’t see anything wrong with the code you have posted. Although it does look like there’s a lot of space between the x-axis and the top of the legend - do you happen to have an x-axis title set?

Also, knowing how/when the frame of your chart is set might give us some clues.


Actually, ignore my above post - this issue was fixed in v2.6.1, so our most recent version of the framework should be free of this issue.  :laughing: