Closed GoogleCodeExporter closed 8 years ago
Even simpler, if you create a CPTAxisLabel with some text and set it's
background color, you won't see the background when you enable collapsesLayers
in the hosting view. It displays properly with the collapsesLayers property set
to NO.
Code snippet:
CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:@"X"
textStyle:[CPTTextStyle textStyle]];
newLabel.contentLayer.backgroundColor = [[CPTColor redColor] cgColor];
newLabel.tickLocation = << The tick location >>;
newLabel.offset = << The offset >>;
Original comment by irodrig...@gmail.com
on 4 Apr 2012 at 8:33
Issue 419 has been merged into this issue.
Original comment by eskr...@mac.com
on 4 Apr 2012 at 11:21
I solved this by adding a CPTBorderedLayer with fill set to fillWithColor right
behind the CPTTextLayer instead of using the backgroundColor property of the
CPTTextLayer.
Original comment by irodrig...@gmail.com
on 5 Apr 2012 at 1:52
Core Plot doesn't support the backgroundColor property. The superclass of
CPTTextLayer was changed after the 1.0 release. It is now a subclass of
CPTBorderedLayer which gives it a fill property.
Pull the latest code with Mercurial. Then the code in comment #1 can be changed
to the following:
((CPTTextLayer *)(newLabel.contentLayer)).fill = [CPTFill
fillWithColor:[CPTColor redColor]];
Original comment by eskr...@mac.com
on 22 Apr 2012 at 1:05
Original issue reported on code.google.com by
irodrig...@gmail.com
on 4 Apr 2012 at 8:15Attachments: