title: CorePlot: Data Labels with multiple layers
body: <p>I'm trying to create a plot with both text and an image as the data labels for each point. The code I'm using looks like this;</p>
  
  <pre><code>//Point symbol
  NSInteger symbolIndex = interval.symbolIndex;
  UIImage *img = [Common getPointSymbol:symbolIndex];
  CGRect imageRect = CGRectMake(0, 0 , 60, 50);
  CPTBorderedLayer * imageLayer = [[CPTBorderedLayer alloc] initWithFrame:imageRect];
  imageLayer.fill = [CPTFill fillWithImage:[CPTImage imageWithCGImage:[img CGImage] scale:img.scale]];
  
  //Point text
  CPTMutableTextStyle *dataLabelTextStyle = [CPTMutableTextStyle textStyle];
  dataLabelTextStyle.color    = [CPTColor blackColor];
  dataLabelTextStyle.fontSize = 12.0f;
  dataLabelTextStyle.fontName = @"Helvetica";
  CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:point.title style:dataLabelTextStyle];
  [imageLayer addSublayer:textLayer];
  
  return imageLayer;
  </code></pre>
  
  <p>This works well for the data points that are initially visible on the plot, but for points which are outside the starting plot area only the symbol-images are drawn. If zooming out and forcing the plot to redraw, both layers will again appear. The same problem occurs if reversing the order of the layers, and then only the text layer is drawn. In effect, it seems sublayers are not rendered if starting outside the plot.</p>
  
  <p>Is this a core plot bug? Is it possible to merge layers into one to mitigate this problem?</p>
  
  <p>Thankful for help!</p>