Core-Plot: How to Center a Custom Image Image Symbol

I use a custom image symbol as described in Displaying images on a scatter plot as graphic symbols in Core iOS . Also see Tag Positioning on CPTBarPlot (Core-Plot) for data tag positioning in CPTPlot.

However, I do not see the behavior from CPTScatterPlot.labelOffsetthat I need. Positive values ​​increase the distance between the bottom of the image and the point, and negative values ​​increase the distance between the top of the image and the point. I need to focus the image on a point. See screenshots:

  • positive label Offset values: http://i.stack.imgur.com/O1uSe.png
  • negative label Office values: http://i.stack.imgur.com/E9fkL.png

, CustomImageForScatterPlot drawInContext. , labelOffset , ?

+5
1

. .

-(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot
                           recordIndex:(NSUInteger)index
{
    CPTPlotSymbol *symbol = nil;

    if ( /* use symbol for this index? */ ) {
        symbol = [CPTPlotSymbol ellipsePlotSymbol];
        symbol.fill = [CPTFill fillWithImage:/* symbol image */];
        symbol.size = CGSizeMake(width, height);
    }

    return symbol;
}

, , plotSymbol .

+5

All Articles