Got an answer, having tried a little.
First of all, I created a custom CPTLayer, and inside it was used the image that needs to be filled.
File CustomImageForScatterPlot.h
#import "CPTLayer.h"
@interface CustomImageForScatterPlot : CPTLayer
{
UIImage *_image;
}
-(id)initWithImage:(UIImage *)image;
@end
File CustomImageForScatterPlot.m
#import "CustomImageForScatterPlot.h"
#import "CPTLayer.h"
@implementation CustomImageForScatterPlot
-(void)dealloc{
[_image release];
[super dealloc];
}
-(id)initWithImage:(UIImage *)image{
CGRect f = CGRectMake(0, 0, image.size.width, image.size.height);
if (self = [super initWithFrame:f]) {
_image = [image retain];
}
return self;
}
-(void)drawInContext:(CGContextRef)ctx{
CGContextDrawImage(ctx, self.bounds, _image.CGImage);
}
@end
, Scatter
- (CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index
{
CustomImageForScatterPlot* layer = [[CustomImageForScatterPlot alloc] initWithImage:[UIImage imageNamed:@"dots.png"]];
layer.frame = CGRectMake(2, 0, 34, 6);
return layer;
}
....:)